public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Huan Tang <tanghuan@vivo.com>
To: krzk@kernel.org
Cc: festevam@gmail.com, imx@lists.linux.dev, kernel@pengutronix.de,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, s.hauer@pengutronix.de,
	shawnguo@kernel.org, srini@kernel.org, tanghuan@vivo.com
Subject: Re: [PATCH] nvmem: imx-ocotp: Use helper function devm_clk_get_enabled()
Date: Tue, 24 Jun 2025 16:33:12 +0800	[thread overview]
Message-ID: <20250624083312.453-1-tanghuan@vivo.com> (raw)
In-Reply-To: <5b048b32-36b4-4c4f-aefb-058674147b76@kernel.org>

>>> diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
>>> index 79dd4fda0329..ce5970ba4033 100644
>>> --- a/drivers/nvmem/imx-ocotp.c
>>> +++ b/drivers/nvmem/imx-ocotp.c
>>> @@ -605,7 +605,7 @@ static int imx_ocotp_probe(struct platform_device *pdev)
>>>  	if (IS_ERR(priv->base))
>>>  		return PTR_ERR(priv->base);
>>>  
>>> -	priv->clk = devm_clk_get(dev, NULL);
>>> +	priv->clk = devm_clk_get_enabled(dev, NULL);
>> 
>> This is just confusing or even wrong. You do not understand the code,
>> just blindly do some changes pointed by scripting.
>> 
>> NAK.
>
>
> I spotted error path further, so let's correct above: it is not only
> confusing, but you introduce actual bugs!
>

Hi  krzk sir,

Thank you for your reply and guidance.

This patch does have the problem of double clk_unprepare_disable.
The usage scenarios of devm_clk_get_enabled are limited, as described below:

Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables (and possibly
prepares) the clocks for the whole lifetime of the device.

I will learn from you and improve the standards of patch upstream in the future.
such as this patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0fa8ce76b713a31f6aef2f88d08eee74d7d3d8a7

>
> No for another round of terrible vivo.com scripted bugs.

To clarify: 
This is my personal mistake. Hope you have a good impression of "vivo.com".

Thanks
Huan


  reply	other threads:[~2025-06-24  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24  3:23 [PATCH] nvmem: imx-ocotp: Use helper function devm_clk_get_enabled() Huan Tang
2025-06-24  6:50 ` Krzysztof Kozlowski
2025-06-24  6:52   ` Krzysztof Kozlowski
2025-06-24  8:33     ` Huan Tang [this message]
2025-06-24  8:36       ` Krzysztof Kozlowski

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=20250624083312.453-1-tanghuan@vivo.com \
    --to=tanghuan@vivo.com \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --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