Re: [PATCH 09/10] dmaengine: mcf-edma: fix wrong error handling
From: Frank Li
Date: Wed Dec 02 2026 - 11:51:27 EST
On Tue, Dec 01, 2026 at 11:40:20PM +0100, Angelo Dureghello wrote:
> [You don't often get email from angelo@xxxxxxxxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Fix wrong error handling on error interrupt.
can you talk a little more detail. such as previous code miss check high
32 bit channel. Fix it by add check errh beside errl.
Frank
>
> Reported-by: Sashiko AI Review <sashiko-bot@xxxxxxxxxx>
> Link: https://sashiko.dev/#/patchset/20260907134037.1855408-4-gerg@xxxxxxxxxxxxxx?part=1
> Fixes: e7a3ff92eaf1 ("dmaengine: fsl-edma: add ColdFire mcf5441x edma support")
> Signed-off-by: Angelo Dureghello <angelo@xxxxxxxxxxxxxxxx>
> ---
> drivers/dma/mcf-edma-main.c | 23 +++++++----------------
> 1 file changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
> index 281919f59612..60940c891409 100644
> --- a/drivers/dma/mcf-edma-main.c
> +++ b/drivers/dma/mcf-edma-main.c
> @@ -42,29 +42,20 @@ static irqreturn_t mcf_edma_err_handler(int irq, void *dev_id)
> {
> struct fsl_edma_engine *mcf_edma = dev_id;
> struct edma_regs *regs = &mcf_edma->regs;
> - unsigned int err, ch;
> -
> - err = ioread32be(regs->errl);
> - if (!err)
> - return IRQ_NONE;
> -
> - for (ch = 0; ch < (EDMA_CHANNELS / 2); ch++) {
> - if (err & BIT(ch)) {
> - fsl_edma_disable_request(&mcf_edma->chans[ch]);
> - iowrite8(EDMA_CERR_CERR(ch), regs->cerr);
> - fsl_edma_err_chan_handler(&mcf_edma->chans[ch]);
> - }
> - }
> + unsigned int ch;
> + u64 err;
>
> err = ioread32be(regs->errh);
> + err <<= 32;
> + err |= ioread32be(regs->errl);
> if (!err)
> return IRQ_NONE;
>
> - for (ch = (EDMA_CHANNELS / 2); ch < EDMA_CHANNELS; ch++) {
> - if (err & (BIT(ch - (EDMA_CHANNELS / 2)))) {
> + for (ch = 0; ch < EDMA_CHANNELS; ch++) {
> + if (err & BIT_U64(ch)) {
> fsl_edma_disable_request(&mcf_edma->chans[ch]);
> iowrite8(EDMA_CERR_CERR(ch), regs->cerr);
> - mcf_edma->chans[ch].status = DMA_ERROR;
> + fsl_edma_err_chan_handler(&mcf_edma->chans[ch]);
> }
> }
>
>
> --
> 2.56.1
>