diff mbox

[v2] PM / runtime: Document steps for device removal

Message ID 1459653787-5963-1-git-send-email-krzk@kernel.org (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show

Commit Message

Krzysztof Kozlowski April 3, 2016, 3:23 a.m. UTC
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(+)

Comments

Alan Stern April 3, 2016, 6:27 p.m. UTC | #1
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>

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki April 6, 2016, 11:34 p.m. UTC | #2
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!

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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,