lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250624083312.453-1-tanghuan@vivo.com>
Date: Tue, 24 Jun 2025 16:33:12 +0800
From: Huan Tang <tanghuan@...o.com>
To: krzk@...nel.org
Cc: festevam@...il.com,
	imx@...ts.linux.dev,
	kernel@...gutronix.de,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	s.hauer@...gutronix.de,
	shawnguo@...nel.org,
	srini@...nel.org,
	tanghuan@...o.com
Subject: Re: [PATCH] nvmem: imx-ocotp: Use helper function devm_clk_get_enabled()

>>> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ