Re: [PATCH 02/17] dmaengine: dw-edma: Fix HDMA channel status register access
From: Frank Li
Date: Mon Jun 15 2026 - 14:32:15 EST
On Tue, Jun 16, 2026 at 12:40:56AM +0900, Koichiro Den wrote:
> GET_CH_32() takes the direction before the channel ID, but
> dw_hdma_v0_core_ch_status() passed them in the opposite order. This can
> make the status callback read another HDMA channel status register.
>
> Use the same argument order as the other HDMA register accesses.
>
> Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
> ---
> Given Devendra's comment on
> a28adc76-044b-4666-bda0-d7f9a8d52a63@xxxxxxx,
> I expect he will soon submit a very similar patch. If so, please prefer
> his patch over this one if it works. I included this fix here since the
> rest of this series makes this pre-existing bug easier to hit.
I provide review-by here, so vnod can be free pick any one.
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
>
> drivers/dma/dw-edma/dw-hdma-v0-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> index 7f9fe3a6edd9..862375c8e4ba 100644
> --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c
> +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> @@ -79,7 +79,7 @@ static enum dma_status dw_hdma_v0_core_ch_status(struct dw_edma_chan *chan)
> u32 tmp;
>
> tmp = FIELD_GET(HDMA_V0_CH_STATUS_MASK,
> - GET_CH_32(dw, chan->id, chan->dir, ch_stat));
> + GET_CH_32(dw, chan->dir, chan->id, ch_stat));
>
> if (tmp == 1)
> return DMA_IN_PROGRESS;
> --
> 2.51.0
>