All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
@ 2026-07-06 14:57 Greg Kroah-Hartman
  2026-07-06 15:10 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-06 14:57 UTC (permalink / raw)
  To: dmaengine
  Cc: linux-kernel, Griffin Kroah-Hartman, stable, Frank Li, Vinod Koul,
	imx, Greg Kroah-Hartman

From: Griffin Kroah-Hartman <griffin@kroah.com>

Add error handling statement to fls_edma3_irq_init() for the
devm_kasprintf call.

Assisted-by: gkh_clanker_2000
Cc: stable <stable@kernel.org>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: imx@lists.linux.dev
Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/dma/fsl-edma-main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
index 36155ab1602a..d9fb717b5b53 100644
--- a/drivers/dma/fsl-edma-main.c
+++ b/drivers/dma/fsl-edma-main.c
@@ -414,6 +414,8 @@ static int fsl_edma3_irq_init(struct platform_device *pdev, struct fsl_edma_engi
 
 		errirq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s-err",
 					     dev_name(&pdev->dev));
+		if (!errirq_name)
+			return -ENOMEM;
 
 		ret = devm_request_irq(&pdev->dev, fsl_edma->errirq, fsl_edma3_err_handler_shared,
 				       0, errirq_name, fsl_edma);
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-06 14:57 [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf Greg Kroah-Hartman
@ 2026-07-06 15:10 ` sashiko-bot
  2026-07-06 16:31 ` Frank Li
  2026-07-14 12:36 ` Vinod Koul
  2 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-06 15:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: dmaengine, vkoul, Frank.Li, imx

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

Pre-existing issues:
- [High] The driver masks `-EPROBE_DEFER` from both `platform_get_irq()` and `platform_get_irq_optional()`.
- [High] Missing explicit cleanup of `txirq_16_31` in `fsl_edma_irq_exit()` creates a race condition during module removal.
- [High] Use of `BIT()` instead of `BIT_ULL()` with a `u64` bitmask causes shift out of bounds on 32-bit platforms.
--

commit dcca75c04a71e337392f5a5707b96105b925f750
Author: Griffin Kroah-Hartman <griffin@kroah.com>

dmaengine: fl1-edma: Add error handling for devm_kasprintf
    
Add error handling statement to fls_edma3_irq_init() for the
devm_kasprintf call.

> diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
> index 36155ab1602a9..d9fb717b5b53c 100644
> --- a/drivers/dma/fsl-edma-main.c
> +++ b/drivers/dma/fsl-edma-main.c
> @@ -414,6 +414,8 @@ static int fsl_edma3_irq_init(struct platform_device *pdev, struct fsl_edma_engi
>  
>  		errirq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s-err",
>  					     dev_name(&pdev->dev));
> +		if (!errirq_name)
> +			return -ENOMEM;
>  
>  		ret = devm_request_irq(&pdev->dev, fsl_edma->errirq, fsl_edma3_err_handler_shared,
>  				       0, errirq_name, fsl_edma);

[Severity: High]
This isn't a bug introduced by this patch, but while modifying 
fsl_edma3_irq_init(), does the driver mask -EPROBE_DEFER from 
platform_get_irq() and platform_get_irq_optional()?

drivers/dma/fsl-edma-main.c:fsl_edma3_irq_init() {
    ...
		fsl_chan->txirq = platform_get_irq(pdev, i);
		if (fsl_chan->txirq < 0)
			return  -EINVAL;
    ...
		fsl_edma->errirq = platform_get_irq_optional(pdev, fsl_edma->n_chans);
		if (fsl_edma->errirq < 0)
			return 0; /* dts miss err irq, treat as no err irq case */
    ...
}

If either of these functions return -EPROBE_DEFER because the IRQ controller
is not yet ready, discarding the error code converts a recoverable probe
deferral into a permanent initialization failure or a silent missing interrupt.

[Severity: High]
This is a pre-existing issue, but can the chan_masked check result in an 
out-of-bounds shift on 32-bit platforms?

drivers/dma/fsl-edma-main.c:fsl_edma3_irq_init() {
    ...
	for (i = 0; i < fsl_edma->n_chans; i++) {
        ...
		if (fsl_edma->chan_masked & BIT(i))
			continue;
    ...
}

Since chan_masked is a u64, using BIT(i) instead of BIT_ULL(i) produces an
unsigned long.

On 32-bit architectures, this evaluates incorrectly for channels 32-63,
proceeding with initialization for channels that should have been masked off.

[Severity: High]
This is a pre-existing issue, but is there a race condition during module 
removal due to missing cleanup of txirq_16_31?

drivers/dma/fsl-edma-main.c:fsl_edma_remove() {
    ...
	fsl_edma_irq_exit(pdev, fsl_edma);
	fsl_edma_cleanup_vchan(&fsl_edma->dma_dev);
    ...
}

During fsl_edma_remove(), the driver attempts to silence interrupts
by calling devm_free_irq() in fsl_edma_irq_exit():

drivers/dma/fsl-edma-main.c:fsl_edma_irq_exit() {
    ...
    (missing explicit free of txirq_16_31)
    ...
}

If fsl_edma_irq_exit() fails to free fsl_edma->txirq_16_31, an interrupt
can fire for channels 16-31 while fsl_edma_cleanup_vchan() is tearing down
the virtual channels.

Could this cause the handler to execute on partially destroyed state?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/2026070605-frying-fling-b9c5@gregkh?part=1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-06 14:57 [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf Greg Kroah-Hartman
  2026-07-06 15:10 ` sashiko-bot
@ 2026-07-06 16:31 ` Frank Li
  2026-07-14 12:36 ` Vinod Koul
  2 siblings, 0 replies; 10+ messages in thread
From: Frank Li @ 2026-07-06 16:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: dmaengine, linux-kernel, Griffin Kroah-Hartman, stable, Frank Li,
	Vinod Koul, imx

On Mon, Jul 06, 2026 at 04:57:06PM +0200, Greg Kroah-Hartman wrote:
> From: Griffin Kroah-Hartman <griffin@kroah.com>

Please subject tags

dmaengine: fsl-edma: ....

>
> Add error handling statement to fls_edma3_irq_init() for the
> devm_kasprintf call.

function need ()
devm_kasprintf()

Frank
>
> Assisted-by: gkh_clanker_2000
> Cc: stable <stable@kernel.org>
> Cc: Frank Li <Frank.Li@nxp.com>
> Cc: Vinod Koul <vkoul@kernel.org>
> Cc: imx@lists.linux.dev
> Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/dma/fsl-edma-main.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
> index 36155ab1602a..d9fb717b5b53 100644
> --- a/drivers/dma/fsl-edma-main.c
> +++ b/drivers/dma/fsl-edma-main.c
> @@ -414,6 +414,8 @@ static int fsl_edma3_irq_init(struct platform_device *pdev, struct fsl_edma_engi
>
>  		errirq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s-err",
>  					     dev_name(&pdev->dev));
> +		if (!errirq_name)
> +			return -ENOMEM;
>
>  		ret = devm_request_irq(&pdev->dev, fsl_edma->errirq, fsl_edma3_err_handler_shared,
>  				       0, errirq_name, fsl_edma);
> --
> 2.55.0
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-06 14:57 [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf Greg Kroah-Hartman
  2026-07-06 15:10 ` sashiko-bot
  2026-07-06 16:31 ` Frank Li
@ 2026-07-14 12:36 ` Vinod Koul
  2026-07-14 15:01   ` Markus Elfring
  2026-07-14 15:58   ` Markus Elfring
  2 siblings, 2 replies; 10+ messages in thread
From: Vinod Koul @ 2026-07-14 12:36 UTC (permalink / raw)
  To: dmaengine, Greg Kroah-Hartman
  Cc: linux-kernel, Griffin Kroah-Hartman, stable, Frank Li, imx


On Mon, 06 Jul 2026 16:57:06 +0200, Greg Kroah-Hartman wrote:
> Add error handling statement to fls_edma3_irq_init() for the
> devm_kasprintf call.
> 
> 

Applied, thanks!

[1/1] dmaengine: fl1-edma: Add error handling for devm_kasprintf
      commit: bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-14 12:36 ` Vinod Koul
@ 2026-07-14 15:01   ` Markus Elfring
  2026-07-15  6:00     ` Vinod Koul
  2026-07-14 15:58   ` Markus Elfring
  1 sibling, 1 reply; 10+ messages in thread
From: Markus Elfring @ 2026-07-14 15:01 UTC (permalink / raw)
  To: Vinod Koul, dmaengine, imx, Frank Li, Greg Kroah-Hartman,
	Griffin Kroah-Hartman
  Cc: stable, LKML

> > Add error handling statement to fls_edma3_irq_init() for the
> > devm_kasprintf call.
> Applied, thanks!
> 
> [1/1] dmaengine: fl1-edma: Add error handling for devm_kasprintf
>       commit: bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb

Frank Li requested a corrected patch subject.

Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-14 12:36 ` Vinod Koul
  2026-07-14 15:01   ` Markus Elfring
@ 2026-07-14 15:58   ` Markus Elfring
  2026-07-14 16:05     ` Greg Kroah-Hartman
  1 sibling, 1 reply; 10+ messages in thread
From: Markus Elfring @ 2026-07-14 15:58 UTC (permalink / raw)
  To: Vinod Koul, dmaengine, imx, Frank Li, Greg Kroah-Hartman,
	Griffin Kroah-Hartman
  Cc: stable, LKML

> > Add error handling statement to fls_edma3_irq_init() for the
> > devm_kasprintf call.
> Applied, thanks!
> 
> [1/1] dmaengine: fl1-edma: Add error handling for devm_kasprintf
>       commit: bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb

https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/commit/?h=next&id=bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb

Would it become helpful to add the following tag?


Fixes: d175222f5e90b7e1f23713378823c338fabb3258 ("dmaegnine: fsl-edma: add edma error interrupt handler")


Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-14 15:58   ` Markus Elfring
@ 2026-07-14 16:05     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-14 16:05 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Vinod Koul, dmaengine, imx, Frank Li, Griffin Kroah-Hartman,
	stable, LKML

On Tue, Jul 14, 2026 at 05:58:32PM +0200, Markus Elfring wrote:
> > > Add error handling statement to fls_edma3_irq_init() for the
> > > devm_kasprintf call.
> …
> > Applied, thanks!
> > 
> > [1/1] dmaengine: fl1-edma: Add error handling for devm_kasprintf
> >       commit: bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/commit/?h=next&id=bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb
> 
> Would it become helpful to add the following tag?
> 
> 
> Fixes: d175222f5e90b7e1f23713378823c338fabb3258 ("dmaegnine: fsl-edma: add edma error interrupt handler")
> 
> 
> Regards,
> Markus

Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list.  I strongly suggest that you not do this anymore.  Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all.  The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback.  Please feel free to also ignore emails
from them.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-14 15:01   ` Markus Elfring
@ 2026-07-15  6:00     ` Vinod Koul
  2026-07-15  6:11       ` Markus Elfring
  0 siblings, 1 reply; 10+ messages in thread
From: Vinod Koul @ 2026-07-15  6:00 UTC (permalink / raw)
  To: Markus Elfring
  Cc: dmaengine, imx, Frank Li, Greg Kroah-Hartman,
	Griffin Kroah-Hartman, stable, LKML

On 14-07-26, 17:01, Markus Elfring wrote:
> > > Add error handling statement to fls_edma3_irq_init() for the
> > > devm_kasprintf call.
> …
> > Applied, thanks!
> > 
> > [1/1] dmaengine: fl1-edma: Add error handling for devm_kasprintf
> >       commit: bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb
> 
> Frank Li requested a corrected patch subject.

Which was done while applying
bf1af4dfdc01 dmaengine: fsl-edma: Add error handling for devm_kasprintf

-- 
~Vinod

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-15  6:00     ` Vinod Koul
@ 2026-07-15  6:11       ` Markus Elfring
  2026-07-15  6:35         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Elfring @ 2026-07-15  6:11 UTC (permalink / raw)
  To: Vinod Koul, dmaengine, imx
  Cc: Frank Li, Greg Kroah-Hartman, Griffin Kroah-Hartman, stable, LKML

>>>> Add error handling statement to fls_edma3_irq_init() for the
>>>> devm_kasprintf call.
>> …
>>> Applied, thanks!
>>>
>>> [1/1] dmaengine: fl1-edma: Add error handling for devm_kasprintf
>>>       commit: bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb
>>
>> Frank Li requested a corrected patch subject.
> 
> Which was done while applying
> bf1af4dfdc01 dmaengine: fsl-edma: Add error handling for devm_kasprintf
I find it unfortunate that an improvable text was mentioned in the notification.

Did different development opinions remain if all involved function names
should usually be marked with parentheses?

Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf
  2026-07-15  6:11       ` Markus Elfring
@ 2026-07-15  6:35         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-15  6:35 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Vinod Koul, dmaengine, imx, Frank Li, Griffin Kroah-Hartman,
	stable, LKML

On Wed, Jul 15, 2026 at 08:11:09AM +0200, Markus Elfring wrote:
> >>>> Add error handling statement to fls_edma3_irq_init() for the
> >>>> devm_kasprintf call.
> >> …
> >>> Applied, thanks!
> >>>
> >>> [1/1] dmaengine: fl1-edma: Add error handling for devm_kasprintf
> >>>       commit: bf1af4dfdc017dfe989c0dbcf0e608dc95f1d2cb
> >>
> >> Frank Li requested a corrected patch subject.
> > 
> > Which was done while applying
> > bf1af4dfdc01 dmaengine: fsl-edma: Add error handling for devm_kasprintf
> I find it unfortunate that an improvable text was mentioned in the notification.
> 
> Did different development opinions remain if all involved function names
> should usually be marked with parentheses?
> 
> Regards,
> Markus

Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list.  I strongly suggest that you not do this anymore.  Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all.  The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback.  Please feel free to also ignore emails
from them.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-07-15  6:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 14:57 [PATCH] dmaengine: fl1-edma: Add error handling for devm_kasprintf Greg Kroah-Hartman
2026-07-06 15:10 ` sashiko-bot
2026-07-06 16:31 ` Frank Li
2026-07-14 12:36 ` Vinod Koul
2026-07-14 15:01   ` Markus Elfring
2026-07-15  6:00     ` Vinod Koul
2026-07-15  6:11       ` Markus Elfring
2026-07-15  6:35         ` Greg Kroah-Hartman
2026-07-14 15:58   ` Markus Elfring
2026-07-14 16:05     ` Greg Kroah-Hartman

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.