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: <20240830024750.2908738-1-xirui.zhang@vivo.com>
Date: Thu, 29 Aug 2024 20:47:50 -0600
From: zhangxirui <xirui.zhang@...o.com>
To: ulf.hansson@...aro.org
Cc: adrian.hunter@...el.com,
	bastien.curutchet@...tlin.com,
	festevam@...il.com,
	imx@...ts.linux.dev,
	jh80.chung@...sung.com,
	kernel@...gutronix.de,
	linus.walleij@...aro.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	linux-mmc@...r.kernel.org,
	michal.simek@....com,
	nico@...xnic.net,
	orito.takao@...ionext.com,
	rric@...nel.org,
	s.hauer@...gutronix.de,
	shawnguo@...nel.org,
	sugaya.taichi@...ionext.com,
	u.kleine-koenig@...gutronix.de,
	xirui.zhang@...o.com
Subject: Re: [PATCH 0/9] mmc: convert to devm_clk_get_enabled() API

On Wed, 28 Aug 2024 at 17:11, Ulf Hansson <ulf.hansson@...aro.org> wrote: 

> On Tue, 27 Aug 2024 at 09:34, zhangxirui <xirui.zhang@...o.com> wrote:
> >
> > This series use devm_clk_get_enabled() to simplify code
> > and avoids the calls to clk_disable_unprepare()
> 
> I agree that it simplifies code - but it also changes the behaviour,
> in which order clocks are getting unprepared/disabled during the
> ->remove() phase. In other words, this needs to be thoroughly tested
> and not just considered as a trivial cleanup series.
> 
> For example, if there is a PM domain attached to the mmc host device,
> is it really okay to allow powering-off the PM domain before the
> clocks are being gated? This could potentially happen if we apply the
> $subject series.

Thanks for the reply, are you saying that merging the above patch will 
lead to the following issue?

before:
bus_remove -> driver_remove -> clk unprepare 
           -> dev_pm_domain_detach
           -> device_unbind_cleanup
after:
bus_remove -> driver_remove (delete clk unprepare) 
           -> dev_pm_domain_detach 
           -> device_unbind_cleanup (devm_clk_get_enbaled ->relase(clk unprepare))

But I think this issue is not only specific to the MMC host, it will also 
occur with other devices, if there is a PM domain attachded an use devm_clk_get_enbaled API. 

So, can we solve this problem by swap device_ubind_cleanup and dev_pm_domain_detach ? 
clk unprepare -> power off not power off -> clk unprepare

bus_remove -> driver_remove 
           -> device_unbind_cleanup
           -> dev_pm_domain_detach 

Thanks.

> >
> > zhangxirui (9):
> >   mmc: cavium-thunderx: Use devm_clk_get_enabled() helpers
> >   mmc: davinci_mmc: Use devm_clk_get_enabled() helpers
> >   mmc: dw_mmc-hi3798cv200: Use devm_clk_get_enabled() helpers
> >   mmc: mvsdio: Use devm_clk_get_enabled() helpers
> >   mmc: mxcmmc: Use devm_clk_get_enabled() helpers
> >   mmc: mxs-mmc: Use devm_clk_get_enabled() helpers
> >   mmc: sdhci: milbeaut: Use devm_clk_get_enabled() helpers
> >   mmc: sdhci-of-arasan: Use devm_clk_get_enabled() helpers
> >   mmc: sdhci_f_sdh30: Use devm_clk_get_enabled() helpers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ