Re: [PATCH 4/6] dmaengine: plx_dma: add dma_rmb() after observing write-back status

From: Frank Li

Date: Fri Nov 06 2026 - 12:53:24 EST


On Tue, Nov 03, 2026 at 09:51:59AM -0600, Logan Gunthorpe wrote:
> 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();
> +

Is it false alarm by sashiko? follow code have dependence with 'flags'.

which part in Documentation/memory-barriers.txt show here need dma_rmb()?

Frank

> res.residue = desc->orig_size - (flags & PLX_DESC_SIZE_MASK);
>
> if (flags & PLX_DESC_WB_SUCCESS)
> --
> 2.47.3
>