From: Frank Li <Frank.li@oss.nxp.com>
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: Mon, 31 Aug 2026 10:49:09 -0500 [thread overview]
Message-ID: <apWidZ2gLboed5Ug@SMW015318> (raw)
In-Reply-To: <20260830131253.2718-1-pengpeng@iscas.ac.cn>
On Sun, Aug 30, 2026 at 09:12:53PM +0800, Pengpeng Hou wrote:
> 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.
Nit: wrap to first line
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> 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
>
>
next prev parent reply other threads:[~2026-08-31 15:49 UTC|newest]
Thread overview: 4+ 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-30 13:24 ` sashiko-bot
2026-08-31 15:49 ` Frank Li [this message]
2026-09-01 13:40 ` Martin Kaiser
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=apWidZ2gLboed5Ug@SMW015318 \
--to=frank.li@oss.nxp.com \
--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 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.