[PATCH 4/6] dmaengine: plx_dma: add dma_rmb() after observing write-back status
From: Logan Gunthorpe
Date: Tue Nov 03 2026 - 12:01:55 EST
Add a dma_rmb() after the write-back status check so reads of the
transferred data can't be satisfied before the read that showed the
transfer was complete.
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Link: https://lore.kernel.org/dmaengine/20260717223217.B6FBF1F000E9@xxxxxxxxxxxxxxx
Signed-off-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>
---
drivers/dma/plx_dma.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/dma/plx_dma.c b/drivers/dma/plx_dma.c
index 1c995f0c4463..e4243b66f933 100644
--- a/drivers/dma/plx_dma.c
+++ b/drivers/dma/plx_dma.c
@@ -148,6 +148,12 @@ static void plx_dma_process_desc(struct plx_dma_dev *plxdev)
if (flags & PLX_DESC_FLAG_VALID)
break;
+ /*
+ * Ensure the write-back status is read before the
+ * completed transfer's payload.
+ */
+ dma_rmb();
+
res.residue = desc->orig_size - (flags & PLX_DESC_SIZE_MASK);
if (flags & PLX_DESC_WB_SUCCESS)
--
2.47.3