From: Martin Kaiser <martin@kaiser.cx>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: Olivia Mackall <olivia@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
linux-crypto@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwrng: imx-rngc: propagate clock enable errors
Date: Tue, 1 Sep 2026 15:40:11 +0200 [thread overview]
Message-ID: <apbVu9mZpjslNi6k@akranes.kaiser.cx> (raw)
In-Reply-To: <20260830131253.2718-1-pengpeng@iscas.ac.cn>
Thus wrote Pengpeng Hou (pengpeng@iscas.ac.cn):
> imx_rngc_probe() reads hardware registers after enabling its clock without
> checking the result, and the runtime resume callback always reports success
> after the same unchecked operation.
> Propagate clock-enable errors before accessing the RNG and to the
> runtime-PM
> core on resume.
> Fixes: 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC")
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
> drivers/char/hw_random/imx-rngc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
> index 7693328f10564..00a21d62c79c3 100644
> --- a/drivers/char/hw_random/imx-rngc.c
> +++ b/drivers/char/hw_random/imx-rngc.c
> @@ -266,7 +266,9 @@ static int __init imx_rngc_probe(struct platform_device *pdev)
> if (irq < 0)
> return irq;
> - clk_prepare_enable(rngc->clk);
> + ret = clk_prepare_enable(rngc->clk);
> + if (ret)
> + return ret;
> ver_id = readl(rngc->base + RNGC_VER_ID);
> rng_type = FIELD_GET(RNG_TYPE, ver_id);
> @@ -338,9 +340,7 @@ static int imx_rngc_resume(struct device *dev)
> {
> struct imx_rngc *rngc = dev_get_drvdata(dev);
> - clk_prepare_enable(rngc->clk);
> -
> - return 0;
> + return clk_prepare_enable(rngc->clk);
> }
> static const struct dev_pm_ops imx_rngc_pm_ops = {
> base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
> --
> 2.50.1
The same patch was sent 2 days ago.
https://lore.kernel.org/linux-crypto/apHlIGM3_GHf86fK@SMW015318/T/#t
prev parent reply other threads:[~2026-09-01 13:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 13:12 [PATCH] hwrng: imx-rngc: propagate clock enable errors Pengpeng Hou
2026-08-31 15:49 ` Frank Li
2026-09-01 13:40 ` Martin Kaiser [this message]
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=apbVu9mZpjslNi6k@akranes.kaiser.cx \
--to=martin@kaiser.cx \
--cc=Frank.Li@nxp.com \
--cc=festevam@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olivia@selenic.com \
--cc=pengpeng@iscas.ac.cn \
--cc=s.hauer@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox