linux/drivers/rpmsg
Chunkai Deng 786439ad58 rpmsg: glink: smem: order FIFO read after availability check
glink_smem_rx_peek() reads the RX FIFO payload after the caller has
determined data is available via glink_smem_rx_avail(), which reads the
remote-updated head index. A control dependency between the head read
and the subsequent payload read does not order the two loads, so the
CPU may speculatively read the FIFO before observing the head update
and consume stale data the remote has not yet published.

Add rmb() in glink_smem_rx_peek() before the memcpy_fromio() so the
availability (head) read is ordered ahead of the FIFO payload read,
matching the consumer pattern in
Documentation/core-api/circular-buffers.rst.

Fixes: caf989c350 ("rpmsg: glink: Introduce glink smem based transport")
Cc: stable@vger.kernel.org
Signed-off-by: Chunkai Deng <chunkai.deng@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260618-rpmsg-glink-smem-mb-v1-1-68a026453a69@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2026-07-13 22:11:52 -05:00
..
Kconfig
Makefile
mtk_rpmsg.c
qcom_glink_native.c rpmsg: glink: fix deadlock in endpoint destroy during driver detach 2026-07-13 21:55:29 -05:00
qcom_glink_native.h
qcom_glink_rpm.c
qcom_glink_smem.c rpmsg: glink: smem: order FIFO read after availability check 2026-07-13 22:11:52 -05:00
qcom_glink_ssr.c
qcom_glink_trace.h
qcom_smd.c rpmsg: Replace sprintf() with sysfs_emit() in sysfs show 2026-07-09 14:45:34 -05:00
rpmsg_char.c rpmsg: char: Check for ongoing chrdev destroy 2026-07-09 15:11:17 -05:00
rpmsg_char.h
rpmsg_core.c rpmsg: core: Fix incorrect return value documentation 2026-07-09 14:45:37 -05:00
rpmsg_ctrl.c
rpmsg_internal.h
rpmsg_ns.c
virtio_rpmsg_bus.c