mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
rpmsg: glink: Set tail pointer to 0 at end of FIFO
When wrapping around the FIFO, the remote expects the tail pointer to be reset to 0 on the edge case where the tail equals the FIFO length. Change-Id: Ib0d2e7c3e9a3524a37792ec8cef3a2aac90e1bf6 Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
parent
a0d79a3b58
commit
81a2f9e41c
@ -116,7 +116,7 @@ static void glink_smem_rx_advance(struct qcom_glink_pipe *np,
|
||||
tail = le32_to_cpu(*pipe->tail);
|
||||
|
||||
tail += count;
|
||||
if (tail > pipe->native.length)
|
||||
if (tail >= pipe->native.length)
|
||||
tail -= pipe->native.length;
|
||||
|
||||
*pipe->tail = cpu_to_le32(tail);
|
||||
|
@ -105,7 +105,7 @@ static void glink_spss_rx_advance(struct qcom_glink_pipe *np,
|
||||
tail = le32_to_cpu(*pipe->tail);
|
||||
|
||||
tail += count;
|
||||
if (tail > pipe->native.length)
|
||||
if (tail >= pipe->native.length)
|
||||
tail -= pipe->native.length;
|
||||
|
||||
*pipe->tail = cpu_to_le32(tail);
|
||||
|
Loading…
x
Reference in New Issue
Block a user