mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] crypto: amlogic: Fix IRQ handler return value and fallthrough logic
@ 2026-09-08 16:01 Mohamad Raizudeen
  2026-09-18  8:52 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Mohamad Raizudeen @ 2026-09-08 16:01 UTC (permalink / raw)
  To: herbert, clabbe, davem
  Cc: skhan, me, jkoolstra, linux-crypto, linux-amlogic, linux-kernel,
	Mohamad Raizudeen, stable

In irqreturn_t_meson_irq_handler(), when an interrupt matches a flow
but the status register is empty, the driver prints an error but
doesn't return. It falls through the loop and incorrectly prints an
`unknown irq` message.

Fix this by returning IRQ_HANDLED immediately after the error print.

Additionally, the handler returns IRQ_HANDLED for genuinely unknown
interrupts. This masks false interrupts and prevents the kernel from
detecting interrupts. Return IRQ_NONE instead for unhandled
interrupts.

Cc: stable@vger.kernel.org
Fixes: 48fe583fe5417 ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
---
 drivers/crypto/amlogic/amlogic-gxl-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c
index 6cb33949915f..302b398405e2 100644
--- a/drivers/crypto/amlogic/amlogic-gxl-core.c
+++ b/drivers/crypto/amlogic/amlogic-gxl-core.c
@@ -38,11 +38,12 @@ static irqreturn_t meson_irq_handler(int irq, void *data)
 				return IRQ_HANDLED;
 			}
 			dev_err(mc->dev, "%s %d Got irq for flow %d but ctrl is empty\n", __func__, irq, flow);
+			return IRQ_HANDLED; 
 		}
 	}
 
 	dev_err(mc->dev, "%s %d from unknown irq\n", __func__, irq);
-	return IRQ_HANDLED;
+	return IRQ_NONE;
 }
 
 static struct meson_alg_template mc_algs[] = {
-- 
2.53.0


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

* Re: [PATCH] crypto: amlogic: Fix IRQ handler return value and fallthrough logic
  2026-09-08 16:01 [PATCH] crypto: amlogic: Fix IRQ handler return value and fallthrough logic Mohamad Raizudeen
@ 2026-09-18  8:52 ` Herbert Xu
  2026-09-18  9:48   ` Mohamad Raizudeen
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2026-09-18  8:52 UTC (permalink / raw)
  To: Mohamad Raizudeen
  Cc: clabbe, davem, skhan, me, jkoolstra, linux-crypto, linux-amlogic,
	linux-kernel, stable

On Tue, Sep 08, 2026 at 09:31:20PM +0530, Mohamad Raizudeen wrote:
> In irqreturn_t_meson_irq_handler(), when an interrupt matches a flow
> but the status register is empty, the driver prints an error but
> doesn't return. It falls through the loop and incorrectly prints an
> `unknown irq` message.
> 
> Fix this by returning IRQ_HANDLED immediately after the error print.
> 
> Additionally, the handler returns IRQ_HANDLED for genuinely unknown
> interrupts. This masks false interrupts and prevents the kernel from
> detecting interrupts. Return IRQ_NONE instead for unhandled
> interrupts.
> 
> Cc: stable@vger.kernel.org
> Fixes: 48fe583fe5417 ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
> Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
> ---
>  drivers/crypto/amlogic/amlogic-gxl-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Please check

https://sashiko.dev/#/patchset/20260908160120.4805-1-raizudeen.kerneldev%40gmail.com

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] crypto: amlogic: Fix IRQ handler return value and fallthrough logic
  2026-09-18  8:52 ` Herbert Xu
@ 2026-09-18  9:48   ` Mohamad Raizudeen
  0 siblings, 0 replies; 3+ messages in thread
From: Mohamad Raizudeen @ 2026-09-18  9:48 UTC (permalink / raw)
  To: Herbert Xu
  Cc: clabbe, davem, skhan, me, jkoolstra, linux-crypto, linux-amlogic,
	linux-kernel, stable

On Fri, Sep 18, 2026 at 06:52:05PM +1000, Herbert Xu wrote:
> On Tue, Sep 08, 2026 at 09:31:20PM +0530, Mohamad Raizudeen wrote:
> > In irqreturn_t_meson_irq_handler(), when an interrupt matches a flow
> > but the status register is empty, the driver prints an error but
> > doesn't return. It falls through the loop and incorrectly prints an
> > `unknown irq` message.
> > 
> > Fix this by returning IRQ_HANDLED immediately after the error print.
> > 
> > Additionally, the handler returns IRQ_HANDLED for genuinely unknown
> > interrupts. This masks false interrupts and prevents the kernel from
> > detecting interrupts. Return IRQ_NONE instead for unhandled
> > interrupts.
> > 
> > Cc: stable@vger.kernel.org
> > Fixes: 48fe583fe5417 ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
> > Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
> > ---
> >  drivers/crypto/amlogic/amlogic-gxl-core.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Please check
> 
> https://sashiko.dev/#/patchset/20260908160120.4805-1-raizudeen.kerneldev%40gmail.com
> 
> Thanks,
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Hi Herbert,

Thank you for pointing out. I will send the v2 soon.

Thanks,
Mohamad Raizudeen

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

end of thread, other threads:[~2026-09-18  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-08 16:01 [PATCH] crypto: amlogic: Fix IRQ handler return value and fallthrough logic Mohamad Raizudeen
2026-09-18  8:52 ` Herbert Xu
2026-09-18  9:48   ` Mohamad Raizudeen

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®