* [PATCH] rpmsg: glink: smem: Ensure ordering during tx
@ 2017-12-14 20:15 Bjorn Andersson
2017-12-18 22:09 ` Chris Lew
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Andersson @ 2017-12-14 20:15 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson
Cc: linux-remoteproc, linux-kernel, Arun Kumar Neelakantam,
Chris Lew, linux-arm-msm
Ensure the ordering of the fifo write and the update of the write index,
so that the index is not updated before the data has landed in the fifo.
Reported-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
drivers/rpmsg/qcom_glink_smem.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c
index 057528e23d3a..892f2b92a4d8 100644
--- a/drivers/rpmsg/qcom_glink_smem.c
+++ b/drivers/rpmsg/qcom_glink_smem.c
@@ -183,6 +183,9 @@ static void glink_smem_tx_write(struct qcom_glink_pipe *glink_pipe,
if (head >= pipe->native.length)
head -= pipe->native.length;
+ /* Ensure ordering of fifo and head update */
+ wmb();
+
*pipe->head = cpu_to_le32(head);
}
--
2.15.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rpmsg: glink: smem: Ensure ordering during tx
2017-12-14 20:15 [PATCH] rpmsg: glink: smem: Ensure ordering during tx Bjorn Andersson
@ 2017-12-18 22:09 ` Chris Lew
0 siblings, 0 replies; 2+ messages in thread
From: Chris Lew @ 2017-12-18 22:09 UTC (permalink / raw)
To: Bjorn Andersson, Ohad Ben-Cohen
Cc: linux-remoteproc, linux-kernel, Arun Kumar Neelakantam, linux-arm-msm
On 12/14/2017 12:15 PM, Bjorn Andersson wrote:
> Ensure the ordering of the fifo write and the update of the write index,
> so that the index is not updated before the data has landed in the fifo.
>
> Reported-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
Acked-By: Chris Lew <clew@codeaurora.org>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-18 22:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 20:15 [PATCH] rpmsg: glink: smem: Ensure ordering during tx Bjorn Andersson
2017-12-18 22:09 ` Chris Lew
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome