mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Angelo Dureghello <angelo@kernel-space.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	 Greg Ungerer <gerg@linux-m68k.org>,
	Vinod Koul <vkoul@kernel.org>,  Frank Li <Frank.Li@kernel.org>,
	Angelo Dureghello <angelo@sysam.it>,  Frank Li <Frank.Li@nxp.com>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	 dmaengine@vger.kernel.org, imx@lists.linux.dev,
	 Angelo Dureghello <angelo@kernel-space.org>,
	 Sashiko AI Review <sashiko-bot@kernel.org>
Subject: [PATCH 09/10] dmaengine: mcf-edma: fix wrong error handling
Date: Tue, 01 Dec 2026 23:40:20 +0100	[thread overview]
Message-ID: <20261201-wip-ks-stmark2-dma-fix-v1-9-99748ff19937@kernel-space.org> (raw)
In-Reply-To: <20261201-wip-ks-stmark2-dma-fix-v1-0-99748ff19937@kernel-space.org>

Fix wrong error handling on error interrupt.

Reported-by: Sashiko AI Review <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260907134037.1855408-4-gerg@linux-m68k.org?part=1
Fixes: e7a3ff92eaf1 ("dmaengine: fsl-edma: add ColdFire mcf5441x edma support")
Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 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


  parent reply	other threads:[~2026-12-01 22:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 22:40 [PATCH 00/10] m68k: mcf54415: fix ColdFire edma-related issues Angelo Dureghello
2026-12-01 22:40 ` [PATCH 01/10] m68k: add DMA global pool config Angelo Dureghello
2026-12-01 22:40 ` [PATCH 02/10] m68k: add DMA global pool setup Angelo Dureghello
2026-12-01 22:40 ` [PATCH 03/10] m68k: mcf54415: add defines for DMA global pool Angelo Dureghello
2026-12-01 22:40 ` [PATCH 04/10] m68k: mcf54415: add DMA global pool initialization Angelo Dureghello
2026-12-01 22:40 ` [PATCH 05/10] m68K: mcf54415: rename mcf edma clock name Angelo Dureghello
2026-12-01 22:40 ` [PATCH 06/10] m68k: mcf54415: align device name with " Angelo Dureghello
2026-12-01 22:40 ` [PATCH 07/10] dmaengine: mcf-edma: enable edma clock Angelo Dureghello
2026-12-01 22:40 ` [PATCH 08/10] dmaengine: mcf-edma: fix wrong BIT() usage on u64 Angelo Dureghello
2026-12-01 22:40 ` Angelo Dureghello [this message]
2026-12-01 22:40 ` [PATCH 10/10] dmaengine: fsl-edma: fix missing big-endian swap Angelo Dureghello
2026-12-02  9:26 ` [PATCH 00/10] m68k: mcf54415: fix ColdFire edma-related issues Jean-Michel Hautbois
2026-12-02 12:12   ` Angelo Dureghello
2026-12-02 12:53     ` Jean-Michel Hautbois

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=20261201-wip-ks-stmark2-dma-fix-v1-9-99748ff19937@kernel-space.org \
    --to=angelo@kernel-space.org \
    --cc=Frank.Li@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=angelo@sysam.it \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=imx@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=sashiko-bot@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®