lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aULYecvJAFrMX77e@lizhi-Precision-Tower-5810>
Date: Wed, 17 Dec 2025 11:21:13 -0500
From: Frank Li <Frank.li@....com>
To: Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
Cc: Vinod Koul <vkoul@...nel.org>, Greg Ungerer <gerg@...ux-m68k.org>,
	imx@...ts.linux.dev, dmaengine@...r.kernel.org,
	linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/5] dma: mcf-edma: Add per-channel IRQ naming for
 debugging

On Wed, Dec 17, 2025 at 07:34:07AM +0100, Jean-Michel Hautbois wrote:
> Hi Frank,
>
> Le mardi 16 décembre 2025, 16:38:38 heure normale d’Europe centrale Frank Li a
> écrit :
> > On Tue, Dec 16, 2025 at 08:56:01PM +0530, Vinod Koul wrote:
> > > On 26-11-25, 11:12, Frank Li wrote:
> > > > On Wed, Nov 26, 2025 at 09:36:03AM +0100, Jean-Michel Hautbois via B4
> Relay wrote:
> > > > > From: Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
> > > > >
> > > > > 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@...eli.org>
> > > > > ---
> > > > >
> > > > >  drivers/dma/mcf-edma-main.c | 26 ++++++++++++++++++--------
> > > > >  1 file changed, 18 insertions(+), 8 deletions(-)
> > > > >
> > > > > diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
> > > > > index f95114829d80..6a7d88895501 100644
> > > > > --- a/drivers/dma/mcf-edma-main.c
> > > > > +++ b/drivers/dma/mcf-edma-main.c
> > > > > @@ -81,8 +81,14 @@ 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",
> (int)(i - res->start));
> > > > > +		if (!irq_name)
> > > > > +			return -ENOMEM;
> > > > > +
> > > > > +		ret |= request_irq(i, mcf_edma_tx_handler, 0,
> irq_name, mcf_edma);
> > > > > +	}
> > > > >
> > > > >  	if (ret)
> > > > >
> > > > >  		return ret;
> > > >
> > > > The existing code have problem, it should use devm_request_irq(). if one
> > > > irq request failure, return here,  requested irq will not free.
> > >
> > > Why is that an error!
> >
> >         ret = fsl_edma->drvdata->setup_irq(pdev, fsl_edma);
> >         if (ret)
> >                 return ret;
> >
> > if last one of request_irq() failure, mcf_edma_irq_init() return failure.
> > probe will return failure also without free irq.
> >
> > So previous irq by request_irq() is never free at this case.
>
> From kernel/irq/manage.c I see in a nutshell:
> 	request_threaded_irq() {
> 		action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
> 		retval = __setup_irq(irq, desc, action);
> 		if (retval) {
> 			kfree(action->secondary);
> 			kfree(action);
> 		}
> 	}

This should only free current failure irq.

ret |= request_irq(0, ..) success
ret |= request_irq(1, ..) fail

so return ret (failure).

irq1's resource free.

How about irq0's resource?

Frank

>
> I don't see an issue with the existing code then ?
> Am I wrong ?
>
> Thanks,
> JM
>
> >
> > Frank
> >
> > > > You'd better add patch before this one to change to use
> > > > devm_request_irq()
> > >
> > > Not really, devm_ is a not always good option.
> > >
> > > --
> > > ~Vinod
>
>
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ