All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Pan Chuang" <panchuang@vivo.com>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH 04/12] crypto: Remove redundant dev_err()/dev_err_probe()
Date: Fri, 17 Jul 2026 08:16:25 +0000	[thread overview]
Message-ID: <20260717081625.CA5101F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260717080045.191538-5-panchuang@vivo.com>

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

Pre-existing issues:
- [High] Premature IRQ registration before clocks and driver state are initialized
--

--- Patch [4]: [PATCH 04/12] crypto: Remove redundant dev_err()/dev_err_probe() ---
commit 1a1461364ed2dcfb8ce0bfe3945b90a7c3d3835d
Author: Pan Chuang <panchuang@vivo.com>
Subject: crypto: Remove redundant dev_err()/dev_err_probe()

Since devm_request_irq() automatically logs detailed error messages on
failure, this patch removes the now-redundant driver-specific dev_err()
and dev_err_probe() calls across multiple crypto drivers.

> diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
> index b393689400b4c..1bf00df864e8f 100644
> --- a/drivers/crypto/atmel-aes.c
> +++ b/drivers/crypto/atmel-aes.c
> @@ -2369,10 +2369,8 @@ static int atmel_aes_probe(struct platform_device *pdev)
>  
>  	err = devm_request_irq(&pdev->dev, aes_dd->irq, atmel_aes_irq,
>  			       IRQF_SHARED, "atmel-aes", aes_dd);

[Severity: High]
This is a pre-existing issue, but can this premature IRQ request cause a crash?

Since IRQF_SHARED is used here, if another device sharing this IRQ line triggers
an interrupt before the aes_clk is enabled, atmel_aes_irq() will unconditionally
read from the AES_ISR register:

    atmel_aes_irq()
       reg = atmel_aes_read(aes_dd, AES_ISR);

Could this result in a bus fault because the hardware is still unclocked?

> -	if (err) {
> -		dev_err(dev, "unable to request aes irq.\n");
> +	if (err)
>  		goto err_tasklet_kill;
> -	}
>  
>  	/* Initializing the clock */
>  	aes_dd->iclk = devm_clk_get_prepared(&pdev->dev, "aes_clk");

[ ... ]

> diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
> index 133ebc9982362..49cd6b036a86c 100644
> --- a/drivers/crypto/mxs-dcp.c
> +++ b/drivers/crypto/mxs-dcp.c
> @@ -1085,17 +1085,13 @@ static int mxs_dcp_probe(struct platform_device *pdev)
>  
>  	ret = devm_request_irq(dev, dcp_vmi_irq, mxs_dcp_irq, 0,
>  			       "dcp-vmi-irq", sdcp);

[Severity: High]
This is a pre-existing issue, but does this request the IRQ too early?

If a pending interrupt from the bootloader fires immediately here, mxs_dcp_irq()
might access uninitialized data structures, as the locks in sdcp->completion
aren't initialized until later in the mxs_dcp_probe() function.

> -	if (ret) {
> -		dev_err(dev, "Failed to claim DCP VMI IRQ!\n");
> +	if (ret)
>  		return ret;
> -	}

[ ... ]

> diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
> index f31555c0d715b..711909de20130 100644
> --- a/drivers/crypto/omap-aes.c
> +++ b/drivers/crypto/omap-aes.c
> @@ -1172,10 +1172,8 @@ static int omap_aes_probe(struct platform_device *pdev)
>  
>  		err = devm_request_irq(dev, irq, omap_aes_irq, 0,
>  				dev_name(dev), dd);

[Severity: High]
This is a pre-existing issue, but could this lead to a BUG_ON crash?

The IRQ is requested after the device is suspended via pm_runtime_put_sync(),
and dd->in_sg is still NULL. If a pending interrupt fires right after this
registration, could the handler try to access the suspended device or trip
a BUG_ON over the NULL scatterlist?

> -		if (err) {
> -			dev_err(dev, "Unable to grab omap-aes IRQ\n");
> +		if (err)
>  			goto err_irq;
> -		}
>  	}

[ ... ]

> diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
> index 533080b0cddc9..d586f1315de1f 100644
> --- a/drivers/crypto/sahara.c
> +++ b/drivers/crypto/sahara.c
> @@ -1305,8 +1305,7 @@ static int sahara_probe(struct platform_device *pdev)
>  	err = devm_request_irq(&pdev->dev, irq, sahara_irq_handler,
>  			       0, dev_name(&pdev->dev), dev);

[Severity: High]
This is a pre-existing issue, but can the handler execute before the
clocks are ready?

The ipg and ahb clocks are retrieved and enabled after this IRQ registration.
If a bootloader left an interrupt pending, could sahara_irq_handler() attempt
to access unclocked hardware registers?

>  	if (err)
> -		return dev_err_probe(&pdev->dev, err,
> -				     "failed to request irq\n");
> +		return err;
>  
>  	/* clocks */
>  	dev->clk_ipg = devm_clk_get_enabled(&pdev->dev, "ipg");

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260717080045.191538-1-panchuang@vivo.com?part=4

  reply	other threads:[~2026-07-17  8:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  8:00 [PATCH 00/12] crypto: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-17  8:00 ` Pan Chuang
2026-07-17  8:00 ` Pan Chuang
2026-07-17  8:00 ` [PATCH 01/12] crypto: allwinner - Remove redundant dev_err() Pan Chuang
2026-07-17  8:13   ` sashiko-bot
2026-07-17  8:00 ` [PATCH 02/12] crypto: amlogic " Pan Chuang
2026-07-17  8:00   ` Pan Chuang
2026-07-17  8:12   ` sashiko-bot
2026-07-17  8:00 ` [PATCH 03/12] crypto: aspeed " Pan Chuang
2026-07-17  8:00 ` [PATCH 04/12] crypto: Remove redundant dev_err()/dev_err_probe() Pan Chuang
2026-07-17  8:16   ` sashiko-bot [this message]
2026-07-17  8:00 ` [PATCH 05/12] crypto: caam - Remove redundant dev_err() Pan Chuang
2026-07-17  8:00 ` [PATCH 06/12] crypto: ccree " Pan Chuang
2026-07-17  8:00 ` [PATCH 07/12] crypto: sl3516 " Pan Chuang
2026-07-17  8:00 ` [PATCH 08/12] crypto: safexcel " Pan Chuang
2026-07-17  8:00 ` [PATCH 09/12] crypto: keembay " Pan Chuang
2026-07-17  8:00 ` [PATCH 10/12] crypto: octeontx2 " Pan Chuang
2026-07-17  8:00 ` [PATCH 11/12] crypto: rockchip " Pan Chuang
2026-07-17  8:00   ` Pan Chuang
2026-07-17  8:00 ` [PATCH 12/12] crypto: stm32 " Pan Chuang
2026-07-17  8:59   ` Maxime MERE

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=20260717081625.CA5101F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=panchuang@vivo.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 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.