From: Bjorn Andersson Date: Thu, 14 Dec 2017 20:15:46 +0000 (-0800) Subject: rpmsg: glink: smem: Ensure ordering during tx X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9d32497361ff89d2fc8306407de6f04b2bfb2836;p=openwrt%2Fstaging%2Fblogic.git rpmsg: glink: smem: Ensure ordering during tx 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. Acked-By: Chris Lew Reported-by: Arun Kumar Neelakantam Signed-off-by: Bjorn Andersson --- 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); }