linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PM / runtime: Document steps for device removal
@ 2016-04-03  3:23 Krzysztof Kozlowski
  2016-04-03 18:27 ` Alan Stern
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2016-04-03  3:23 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm, linux-kernel
  Cc: Alan Stern, Krzysztof Kozlowski

Put a reminder that during device removal drivers should revert all PM
runtime changes from the probe.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

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,
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] PM / runtime: Document steps for device removal
  2016-04-03  3:23 [PATCH v2] PM / runtime: Document steps for device removal Krzysztof Kozlowski
@ 2016-04-03 18:27 ` Alan Stern
  2016-04-06 23:34   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Stern @ 2016-04-03 18:27 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm, linux-kernel

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 <krzk@kernel.org>
> 
> ---
> 
> 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 <stern@rowland.harvard.edu>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] PM / runtime: Document steps for device removal
  2016-04-03 18:27 ` Alan Stern
@ 2016-04-06 23:34   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2016-04-06 23:34 UTC (permalink / raw)
  To: Alan Stern, Krzysztof Kozlowski
  Cc: Len Brown, Pavel Machek, linux-pm, linux-kernel

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 <krzk@kernel.org>
> > 
> > ---
> > 
> > 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 <stern@rowland.harvard.edu>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-06 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-03  3:23 [PATCH v2] PM / runtime: Document steps for device removal Krzysztof Kozlowski
2016-04-03 18:27 ` Alan Stern
2016-04-06 23:34   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).