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: <e9466a28-5c6a-f88a-51ab-547ecc21e5d0@hisilicon.com>
Date:   Thu, 22 Oct 2020 21:40:34 +0800
From:   "chenxiang (M)" <chenxiang66@...ilicon.com>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:     Linux PM <linux-pm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Lukas Wunner <lukas@...ner.de>,
        Saravana Kannan <saravanak@...gle.com>
Subject: Re: [PATCH 3/3] PM: runtime: Resume the device earlier in
 __device_release_driver()

Hi Rafael,

在 2020/10/22 3:14, Rafael J. Wysocki 写道:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Since the device is resumed from runtime-suspend in
> __device_release_driver() anyway, it is better to do that before
> looking for busy managed device links from it to consumers, because
> if there are any, device_links_unbind_consumers() will be called
> and it will cause the consumer devices' drivers to unbind, so the
> consumer devices will be runtime-resumed.  In turn, resuming each
> consumer device will cause the supplier to be resumed and when the
> runtime PM references from the given consumer to it are dropped, it
> may be suspended.  Then, the runtime-resume of the next consumer
> will cause the supplier to resume again and so on.
>
> Update the code accordingly.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Fixes: 9ed9895370ae ("driver core: Functional dependencies tracking support")
> Cc: All applicable <stable@...r.kernel.org> # All applicable
> ---
>   drivers/base/dd.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-pm/drivers/base/dd.c
> ===================================================================
> --- linux-pm.orig/drivers/base/dd.c
> +++ linux-pm/drivers/base/dd.c
> @@ -1117,6 +1117,8 @@ static void __device_release_driver(stru
>   
>   	drv = dev->driver;
>   	if (drv) {
> +		pm_runtime_get_sync(dev);
> +
>   		while (device_links_busy(dev)) {
>   			__device_driver_unlock(dev, parent);
>   
> @@ -1132,8 +1134,6 @@ static void __device_release_driver(stru

pm_runtime_put_sync() is required to be called if existed from here.

>   				return;
>   		}
>   
> -		pm_runtime_get_sync(dev);
> -
>   		driver_sysfs_remove(dev);
>   
>   		if (dev->bus)
>
>
>
>
> .
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ