Re: [PATCH 3/7] dma: mcf-edma: Add per-channel IRQ naming for debugging

Geert Uytterhoeven
2025-11-24T13:05:32Z

Hi Jean-Michel,

On Mon, 24 Nov 2025 at 13:52, Jean-Michel Hautbois
<jeanmichel.hautbois@yoseli.org> wrote:
> Add dynamic per-channel IRQ naming to make DMA interrupt identification
> easier in /proc/interrupts and debugging tools.
>
> Instead of all channels showing "eDMA", they now show:
> - "eDMA-0" through "eDMA-15" for channels 0-15
> - "eDMA-16" through "eDMA-55" for channels 16-55
> - "eDMA-tx-56" for the shared channel 56-63 interrupt
> - "eDMA-err" for the error interrupt
>
> This aids debugging DMA issues by making it clear which channel's
> interrupt is being serviced.
>
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>

Thanks for your patch!

> --- a/drivers/dma/mcf-edma-main.c
> +++ b/drivers/dma/mcf-edma-main.c
> @@ -81,8 +81,12 @@ static int mcf_edma_irq_init(struct platform_device *pdev,
> if (!res)
> return -1;
>
> - for (ret = 0, i = res->start; i <= res->end; ++i)
> - ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma);
> + for (ret = 0, i = res->start; i <= res->end; ++i) {
> + char *irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
> + "eDMA-%d", i - res->start);

Can return NULL, so needs error handling.

> +
> + ret |= request_irq(i, mcf_edma_tx_handler, 0, irq_name, mcf_edma);
> + }
> if (ret)
> return ret;
>
> @@ -91,15 +95,19 @@ static int mcf_edma_irq_init(struct platform_device *pdev,
> if (!res)
> return -1;
>
> - for (ret = 0, i = res->start; i <= res->end; ++i)
> - ret |= request_irq(i, mcf_edma_tx_handler, 0, "eDMA", mcf_edma);
> + for (ret = 0, i = res->start; i <= res->end; ++i) {
> + char *irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
> + "eDMA-%d", 16 + i - res->start);

Likewise

> +
> + ret |= request_irq(i, mcf_edma_tx_handler, 0, irq_name, mcf_edma);
> + }
> if (ret)
> return ret;
>
> ret = platform_get_irq_byname(pdev, "edma-tx-56-63");
> if (ret != -ENXIO) {
> ret = request_irq(ret, mcf_edma_tx_handler,
> - 0, "eDMA", mcf_edma);
> + 0, "eDMA-tx-56", mcf_edma);

Fits on a single line.

> if (ret)
> return ret;
> }
> @@ -107,7 +115,7 @@ static int mcf_edma_irq_init(struct platform_device *pdev,
> ret = platform_get_irq_byname(pdev, "edma-err");
> if (ret != -ENXIO) {
> ret = request_irq(ret, mcf_edma_err_handler,
> - 0, "eDMA", mcf_edma);
> + 0, "eDMA-err", mcf_edma);

Likewise.

> if (ret)
> return ret;
> }
>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds