All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rpmsg: glink: Set tail pointer to 0 at end of FIFO
@ 2018-06-28  1:19 Chris Lew
  2019-10-11 18:39 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Lew @ 2018-06-28  1:19 UTC (permalink / raw)
  To: bjorn.andersson, andy.gross, david.brown
  Cc: aneela, linux-arm-msm, linux-soc, linux-kernel, clew

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.

Signed-off-by: Chris Lew <clew@codeaurora.org>
---
 drivers/rpmsg/qcom_glink_smem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 2b5cf2790954..7a276be598d6 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -109,7 +109,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);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rpmsg: glink: Set tail pointer to 0 at end of FIFO
  2018-06-28  1:19 [PATCH] rpmsg: glink: Set tail pointer to 0 at end of FIFO Chris Lew
@ 2019-10-11 18:39 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2019-10-11 18:39 UTC (permalink / raw)
  To: Chris Lew
  Cc: andy.gross, david.brown, aneela, linux-arm-msm, linux-soc, linux-kernel

On Wed 27 Jun 18:19 PDT 2018, Chris Lew wrote:

> 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.
> 

Applied

Thanks,
Bjorn

> Signed-off-by: Chris Lew <clew@codeaurora.org>
> ---
>  drivers/rpmsg/qcom_glink_smem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
> index 2b5cf2790954..7a276be598d6 100644
> --- a/drivers/rpmsg/qcom_glink_smem.c
> +++ b/drivers/rpmsg/qcom_glink_smem.c
> @@ -109,7 +109,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);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-11 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28  1:19 [PATCH] rpmsg: glink: Set tail pointer to 0 at end of FIFO Chris Lew
2019-10-11 18:39 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.