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-next>] [day] [month] [year] [list]
Message-ID:
 <KL1PR0601MB4211C193CD204C565F834BB9DE972@KL1PR0601MB4211.apcprd06.prod.outlook.com>
Date: Fri, 30 Aug 2024 07:14:46 +0000
From: 王建政 <wangjianzheng@...o.com>
To: Andrew Lunn <andrew@...n.ch>
CC: Gregory Clement <gregory.clement@...tlin.com>, Sebastian Hesselbarth
	<sebastian.hesselbarth@...il.com>, Linus Walleij <linus.walleij@...aro.org>,
	"moderated list:ARM/Marvell Kirkwood and Armada 370, 375, 38x,..."
	<linux-arm-kernel@...ts.infradead.org>, "open list:PIN CONTROL SUBSYSTEM"
	<linux-gpio@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>,
	opensource.kernel <opensource.kernel@...o.com>
Subject: Re: [PATCH 3/5] pinctrl: mvebu: Use devm_clk_get_enabled() helpers

On Andrew Lunn <andrew@...n.ch> wrote:
>On Thu, Aug 29, 2024 at 02:48:59PM +0800, Wang Jianzheng wrote:
>> The devm_clk_get_enabled() helpers:
>>     - call devm_clk_get()
>>     - call clk_prepare_enable() and register what is needed in order to
>>      call clk_disable_unprepare() when needed, as a managed resource.
>>
>> This simplifies the code and avoids the calls to clk_disable_unprepare().
>>
>> Signed-off-by: Wang Jianzheng <wangjianzheng@...o.com>
>> ---
>>  drivers/pinctrl/mvebu/pinctrl-dove.c | 45 
>> +++++++++-------------------
>>  1 file changed, 14 insertions(+), 31 deletions(-)
>>
>> diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c 
>> b/drivers/pinctrl/mvebu/pinctrl-dove.c
>> index dce601d99372..1c2a292ebbd9 100644
>> --- a/drivers/pinctrl/mvebu/pinctrl-dove.c
>> +++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
>> @@ -767,7 +767,7 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
>>       struct resource fb_res;
>>       struct mvebu_mpp_ctrl_data *mpp_data;
>>       void __iomem *base;
>> -     int i, ret;
>> +     int i;
>>
>>       pdev->dev.platform_data = (void 
>> *)device_get_match_data(&pdev->dev);
>>
>> @@ -775,25 +775,20 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
>>        * General MPP Configuration Register is part of pdma registers.
>>        * grab clk to make sure it is ticking.
>>        */
>> -     clk = devm_clk_get(&pdev->dev, NULL);
>> +     clk = devm_clk_get_enabled(&pdev->dev, NULL);
>>       if (IS_ERR(clk)) {
>>               dev_err(&pdev->dev, "Unable to get pdma clock");
>>               return PTR_ERR(clk);
>>       }
>> -     clk_prepare_enable(clk);
>>
>>       base = devm_platform_get_and_ioremap_resource(pdev, 0, &mpp_res);
>> -     if (IS_ERR(base)) {
>> -             ret = PTR_ERR(base);
>> -             goto err_probe;
>> -     }
>> +     if (IS_ERR(base))
>> +             return PTR_ERR(base); 
>
>It appears that in patch 3 you add all these goto err_probe, and now you delete them?
>
>Please reverse the order of these two patches!
>
>    Andrew

Actually, I add "goto err_probe" in patch2/5 for fix the clock disable error. Based on that,
I delete them in patch3/5. Because I want to use devm_clk_get_enabled() instead of original
 devm_clk_get(), and need to remove the disable clock operation. 

It seems that it is unable to reverse the order of thes two patches. How about combining 
These two patches into one? 

	Wang Jianzheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ