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: <a28990d9-1a3b-4368-bd08-9d3188f4817c@wanadoo.fr>
Date: Mon, 26 Aug 2024 22:17:01 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: liulei.rjpt@...o.com
Cc: daniel@...que.org, gregkh@...uxfoundation.org, haojian.zhuang@...il.com,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-usb@...r.kernel.org, opensource.kernel@...o.com, robert.jarzmik@...e.fr
Subject: Re: [PATCH v3 2/5] usb: pxa27x_udc: Use devm_clk_get_enabled()
 helpers

Le 26/08/2024 à 10:22, Lei Liu a écrit :
> 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 calls to clk_disable_unprepare().
> 

Hi,

The S-o-b should be here, above the first ---.

Same for patch 4 et 5.

> ---
> v2 -> v3
> Fix the email thread.
> 
> ---
> v1 -> v2
> Incorrect usage of clk_prepare_enable() should be
> corrected to devm_clk_get_enabled().
> 
> Signed-off-by: Lei Liu <liulei.rjpt-DGpbCiVdSXo@...lic.gmane.org>


> ---
>   drivers/usb/gadget/udc/pxa27x_udc.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
> index 1a6317e4b2a3..0619507d187e 100644
> --- a/drivers/usb/gadget/udc/pxa27x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa27x_udc.c
> @@ -2398,14 +2398,10 @@ static int pxa_udc_probe(struct platform_device *pdev)
>   	if (udc->gpiod)
>   		gpiod_direction_output(udc->gpiod, 0);
>   
> -	udc->clk = devm_clk_get(&pdev->dev, NULL);
> +	udc->clk = devm_clk_get_enabled(&pdev->dev, NULL);
>   	if (IS_ERR(udc->clk))
>   		return PTR_ERR(udc->clk);
>   
> -	retval = clk_prepare(udc->clk);
> -	if (retval)
> -		return retval;

Also the patches looks truncated, but sometimes my mailer plays me some 
tricks, but it looks ok on lore. See [1].


The clk_unprepare() in the error handling in the probe and in the remove 
function should also be removed.


CJ

[1]: https://lore.kernel.org/all/20240826082218.2331-1-liulei.rjpt@vivo.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ