From: Frank Li <Frank.li@oss.nxp.com>
To: Jiawen Liu <liu1298662399@gmail.com>
Cc: Srinivas Kandagatla <srini@kernel.org>,
Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] nvmem: imx-ocotp: Propagate clock setup errors from probe
Date: Tue, 1 Dec 2026 10:23:47 -0600 [thread overview]
Message-ID: <aw70k3bHO7DQGbgG@SMW015318> (raw)
In-Reply-To: <179598034049.2.7027133837868788777.pattern-ext-112.17@gmail.com>
On Sun, Nov 29, 2026 at 07:25:33PM +0000, Jiawen Liu wrote:
> [You don't often get email from liu1298662399@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> imx_ocotp_probe() ignores the return value of clk_prepare_enable().
> On i.MX6SL, preparing the OCOTP clock can propagate a PLL2 lock timeout
> if PLL2 is selected and the shared clock chain is unprepared. The clock
> provider can still publish the OCOTP gate if registration of the critical
> MMDC IPG gate fails to prepare that chain.
>
> Probe then accesses the OCOTP registers without acquiring the clock,
> attempts an unmatched clk_disable_unprepare(), and can report success
> if NVMEM registration succeeds.
>
> Return the original clock error before clearing the OCOTP status or
> registering NVMEM. On success, release the clock after clearing the
> status, before registering NVMEM.
>
> Verified the probe and devres paths
> by source inspection, ran git diff --check and checkpatch.pl, and built
> imx-ocotp.o with Clang 19 using the ARM imx_v6_v7_defconfig.
> Runtime and hardware reproduction were not performed.
Simple said "Build test only".
Frank
>
> Fixes: c33c585f1b3a ("nvmem: imx-ocotp: reset error status on probe")
> Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
> ---
> drivers/nvmem/imx-ocotp.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
> index 55e07fd919a21..ecc085bb39e31 100644
> --- a/drivers/nvmem/imx-ocotp.c
> +++ b/drivers/nvmem/imx-ocotp.c
> @@ -598,6 +598,7 @@ static int imx_ocotp_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct ocotp_priv *priv;
> struct nvmem_device *nvmem;
> + int ret;
>
> priv = devm_kzalloc_obj(dev, *priv);
> if (!priv)
> @@ -622,7 +623,10 @@ static int imx_ocotp_probe(struct platform_device *pdev)
>
> priv->config = &imx_ocotp_nvmem_config;
>
> - clk_prepare_enable(priv->clk);
> + ret = clk_prepare_enable(priv->clk);
> + if (ret)
> + return ret;
> +
> imx_ocotp_clr_err_if_set(priv);
> clk_disable_unprepare(priv->clk);
>
> --
> 2.34.1
>
prev parent reply other threads:[~2026-12-01 16:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 19:25 [PATCH] nvmem: imx-ocotp: Propagate clock setup errors from probe Jiawen Liu
2026-11-30 2:41 ` Peng Fan (OSS)
2026-12-01 13:56 ` Srinivas Kandagatla
2026-12-01 16:23 ` Frank Li [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=aw70k3bHO7DQGbgG@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=liu1298662399@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=srini@kernel.org \
/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