diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2020-04-21 15:40:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-24 09:01:06 +0300 |
commit | deb1682b6f049bf5e6c496b1b2d45395ee971f32 (patch) | |
tree | 7750a29d0b5a2ddbf9ca6e66e8e233a87834a92b /drivers/rpmsg | |
parent | bb8ca3d39feca1c07cc138ef16675a3ce690b469 (diff) | |
download | linux-deb1682b6f049bf5e6c496b1b2d45395ee971f32.tar.xz |
rpmsg: glink: smem: Ensure ordering during tx
[ Upstream commit 9d32497361ff89d2fc8306407de6f04b2bfb2836 ]
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 <clew@codeaurora.org>
Reported-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r-- | drivers/rpmsg/qcom_glink_smem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c index 69a14041ef1f..ed616b0bc563 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -181,6 +181,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); } |