All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jean-Michel Hautbois" <jeanmichel.hautbois@yoseli.org>
Cc: imx@lists.linux.dev, dmaengine@vger.kernel.org, vkoul@kernel.org,
	Frank.Li@kernel.org
Subject: Re: [PATCH v3 4/5] dmaengine: mcf-edma: Fix error handler for all 64 DMA channels
Date: Thu, 25 Jun 2026 09:17:42 +0000	[thread overview]
Message-ID: <20260625091743.34AD41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260625-b4-edma-dmaengine-v3-4-44be00ace37d@yoseli.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Incomplete Fix / Hardware State Corruption: fsl_edma_disable_request() truncates channel IDs >= 32 when disabling error interrupts.
--

commit 95f12f5cb94b6214f42fed40a0a6ec8cb8002d51
Author: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>

dmaengine: mcf-edma: Fix error handler for all 64 DMA channels

This commit updates the DMA error interrupt handler to properly process errors
on all 64 channels by iterating over a 64-bit mask with for_each_set_bit(). It
also ensures both low and high channel groups consistently use
fsl_edma_err_chan_handler() for error status reporting.

> diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
> index 953b20f99f251..3dab5d475d1b4 100644
> --- a/drivers/dma/mcf-edma-main.c
> +++ b/drivers/dma/mcf-edma-main.c
[ ... ]
> @@ -42,30 +42,22 @@ static irqreturn_t mcf_edma_err_handler(int irq, void *dev_id)
[ ... ]
> -	for (ch = (EDMA_CHANNELS / 2); ch < EDMA_CHANNELS; ch++) {
> -		if (err & (BIT(ch - (EDMA_CHANNELS / 2)))) {
> -			fsl_edma_disable_request(&mcf_edma->chans[ch]);
> -			iowrite8(EDMA_CERR_CERR(ch), regs->cerr);
> -			mcf_edma->chans[ch].status = DMA_ERROR;
> -		}
> +	for_each_set_bit(ch, err_mask, mcf_edma->n_chans) {
> +		fsl_edma_disable_request(&mcf_edma->chans[ch]);

[Severity: High]
This is a pre-existing issue, but does fsl_edma_disable_request() properly
handle channel IDs >= 32?

Looking at fsl_edma_disable_request() in drivers/dma/fsl-edma-common.c, it
uses the EDMA_CEEI_CEEI() macro to write to the ceei register:

    iowrite8(ch, regs->cerq);
    iowrite8(EDMA_CEEI_CEEI(ch), regs->ceei);

However, EDMA_CEEI_CEEI(x) masks the channel ID to 5 bits using GENMASK(4, 0).

When fsl_edma_disable_request() is called for high channels (32-63), the
channel ID will be truncated. For instance, channel 33 would be truncated to 1.

Could this truncation fail to disable the error interrupt for the intended
high channel, leading to a continuous interrupt loop, while erroneously
disabling the interrupt for an unrelated active low channel?

> +		iowrite8(EDMA_MASK_CH(ch), regs->cerr);
> +		fsl_edma_err_chan_handler(&mcf_edma->chans[ch]);
>  	}
>  
>  	return IRQ_HANDLED;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260625-b4-edma-dmaengine-v3-0-44be00ace37d@yoseli.org?part=4

  reply	other threads:[~2026-06-25  9:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25  8:59 [PATCH v3 0/5] dmaengine: mcf-edma: fix 64-channel handling and modernize IRQ setup Jean-Michel Hautbois
2026-06-25  8:59 ` [PATCH v3 1/5] dmaengine: fsl-edma: Move error handler out of header file Jean-Michel Hautbois
2026-06-25  9:18   ` sashiko-bot
2026-06-25 15:33   ` Frank Li
2026-06-25  8:59 ` [PATCH v3 2/5] dmaengine: fsl-edma: Add FSL_EDMA_DRV_MCF flag for ColdFire eDMA Jean-Michel Hautbois
2026-06-25  9:20   ` sashiko-bot
2026-06-25 15:16   ` Frank Li
2026-06-25  8:59 ` [PATCH v3 3/5] dmaengine: mcf-edma: Fix interrupt handler for 64 DMA channels Jean-Michel Hautbois
2026-06-25 15:30   ` Frank Li
2026-06-25  8:59 ` [PATCH v3 4/5] dmaengine: mcf-edma: Fix error handler for all " Jean-Michel Hautbois
2026-06-25  9:17   ` sashiko-bot [this message]
2026-06-25 15:23   ` Frank Li
2026-06-25  8:59 ` [PATCH v3 5/5] dmaengine: mcf-edma: Use devm for per-channel IRQ registration Jean-Michel Hautbois
2026-06-25  9:21   ` sashiko-bot
2026-06-25 15:26   ` Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260625091743.34AD41F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=jeanmichel.hautbois@yoseli.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.