Skip to content

Commit

Permalink
soc: qcom: smd: Correct fBLOCKREADINTR handling
Browse files Browse the repository at this point in the history
fBLOCKREADINTR is masking the notification from the remote and should
hence be cleared while we're waiting the tx fifo to drain. Also change
the reset state to mask the notification, as send is the only use case
where we're interested in it.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Andy Gross <agross@codeaurora.org>
  • Loading branch information
Bjorn Andersson authored and Andy Gross committed Sep 9, 2015
1 parent 93dbed9 commit 208487a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/soc/qcom/smd.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static void qcom_smd_channel_reset(struct qcom_smd_channel *channel)
SET_TX_CHANNEL_INFO(channel, fHEAD, 0);
SET_TX_CHANNEL_INFO(channel, fTAIL, 0);
SET_TX_CHANNEL_INFO(channel, fSTATE, 1);
SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 0);
SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1);
SET_TX_CHANNEL_INFO(channel, head, 0);
SET_TX_CHANNEL_INFO(channel, tail, 0);

Expand Down Expand Up @@ -683,15 +683,15 @@ int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len)
goto out;
}

SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1);
SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 0);

ret = wait_event_interruptible(channel->fblockread_event,
qcom_smd_get_tx_avail(channel) >= tlen ||
channel->state != SMD_CHANNEL_OPENED);
if (ret)
goto out;

SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 0);
SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1);
}

SET_TX_CHANNEL_INFO(channel, fTAIL, 0);
Expand Down

0 comments on commit 208487a

Please sign in to comment.