Skip to contentSkip to conversation

rpmsg: glink: smem: Ensure ordering during tx

PATCH In review Bjorn Andersson 2 participants 2 messages Dec 14, 2017 – Dec 18, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/rpmsg/qcom_glink_smem.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/rpmsg/qcom_glink_smem.c +3 -0
index 057528e23d3a..892f2b92a4d8 100644
@@ -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);
 }
 
Signature · 1 line
2.15.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Bjorn Andersson

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.

---

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project