Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81a2f9e4 authored by Chris Lew's avatar Chris Lew
Browse files

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: default avatarChris Lew <clew@codeaurora.org>
parent a0d79a3b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);