Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754627AbcDFXcP (ORCPT ); Wed, 6 Apr 2016 19:32:15 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:58723 "HELO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752740AbcDFXcO (ORCPT ); Wed, 6 Apr 2016 19:32:14 -0400 From: "Rafael J. Wysocki" To: Alan Stern , Krzysztof Kozlowski Cc: Len Brown , Pavel Machek , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PM / runtime: Document steps for device removal Date: Thu, 07 Apr 2016 01:34:44 +0200 Message-ID: <1951186.4KzpkCHJdR@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.5.0-rc1+; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1418 Lines: 35 On Sunday, April 03, 2016 02:27:27 PM Alan Stern wrote: > On Sun, 3 Apr 2016, Krzysztof Kozlowski wrote: > > > Put a reminder that during device removal drivers should revert all PM > > runtime changes from the probe. > > > > Signed-off-by: Krzysztof Kozlowski > > > > --- > > > > Changes since v1: > > 1. Address Alan's comments. > > --- > > Documentation/power/runtime_pm.txt | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt > > index 7328cf85236c..1fd1fbe9ce95 100644 > > --- a/Documentation/power/runtime_pm.txt > > +++ b/Documentation/power/runtime_pm.txt > > @@ -586,6 +586,10 @@ drivers to make their ->remove() callbacks avoid races with runtime PM directly, > > but also it allows of more flexibility in the handling of devices during the > > removal of their drivers. > > > > +Drivers in ->remove() callback should undo the runtime PM changes done > > +in ->probe(). Usually this means calling pm_runtime_disable(), > > +pm_runtime_dont_use_autosuspend() etc. > > + > > The user space can effectively disallow the driver of the device to power manage > > it at run time by changing the value of its /sys/devices/.../power/control > > attribute to "on", which causes pm_runtime_forbid() to be called. In principle, > > Acked-by: Alan Stern Applied, thanks!