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: <Zsc7chKkKMZLs-bZ@smile.fi.intel.com>
Date: Thu, 22 Aug 2024 16:21:54 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Lei Liu <liulei.rjpt@...o.com>
Cc: Paul Cercueil <paul@...pouillou.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jirislaby@...nel.org>,
	Thierry Reding <thierry.reding@...il.com>,
	Jonathan Hunter <jonathanh@...dia.com>,
	Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Richard Genoud <richard.genoud@...tlin.com>,
	Nicolas Ferre <nicolas.ferre@...rochip.com>,
	Alexandre Belloni <alexandre.belloni@...tlin.com>,
	Claudiu Beznea <claudiu.beznea@...on.dev>,
	Liviu Dudau <liviu.dudau@....com>,
	Sudeep Holla <sudeep.holla@....com>,
	Lorenzo Pieralisi <lpieralisi@...nel.org>,
	Andreas Färber <afaerber@...e.de>,
	Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
	Patrice Chotard <patrice.chotard@...s.st.com>,
	Maxime Coquelin <mcoquelin.stm32@...il.com>,
	Alexandre Torgue <alexandre.torgue@...s.st.com>,
	Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	Andi Shyti <andi.shyti@...ux.intel.com>,
	John Ogness <john.ogness@...utronix.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Jeff Johnson <quic_jjohnson@...cinc.com>,
	Valentin Caron <valentin.caron@...s.st.com>,
	Lino Sanfilippo <l.sanfilippo@...bus.com>,
	Erwan Le Ray <erwan.leray@...s.st.com>, linux-mips@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
	linux-tegra@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-actions@...ts.infradead.org,
	linux-stm32@...md-mailman.stormreply.com,
	opensource.kernel@...o.com
Subject: Re: [PATCH 7/8] tty: st-asc: Use devm_clk_get_enabled() helpers

On Thu, Aug 22, 2024 at 11:39:11AM +0800, Lei Liu 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 calls to clk_disable_unprepare().

...

Same caveat as in another patch comment.

> -	ascport->clk = devm_clk_get(&pdev->dev, NULL);
> +	ascport->clk = devm_clk_get_enabled(&pdev->dev, NULL);
>  
>  	if (WARN_ON(IS_ERR(ascport->clk)))
>  		return -EINVAL;
> -	/* ensure that clk rate is correct by enabling the clk */
> -	ret = clk_prepare_enable(ascport->clk);
> -	if (ret)
> -		return ret;
> +
>  	ascport->port.uartclk = clk_get_rate(ascport->clk);

>  	WARN_ON(ascport->port.uartclk == 0);

Btw, not related to this series, you may try to get rid of these 0 checks as
the serial core has this and it will fail anyway. Perhaps you want to expand
serial core to issue an error message (if it's not done yet).

> -	clk_disable_unprepare(ascport->clk);

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ