Skip to contentSkip to conversation

PM / runtime: Document steps for device removal

PATCH Applied Krzysztof Kozlowski 3 participants 3 messages Apr 3, 2016 – Apr 6, 2016 Suspend to RAM

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PM / runtime: Document steps for device removal

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

---

Changes since v1:
1. Address Alan's comments.

---
 Documentation/power/runtime_pm.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/power/runtime_pm.txt +4 -0
index 7328cf85236c..1fd1fbe9ce95 100644
@@ -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,
Signature · 1 line
2.1.4
Acked-by on v2 1/1
#1 lore raw
Quoted 18 lines · Krzysztof Kozlowski

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

---

Changes since v1:
1. Address Alan's comments.

---
 Documentation/power/runtime_pm.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/power/runtime_pm.txt +0 -0
index 7328cf85236c..1fd1fbe9ce95 100644

Documentation/power/runtime_pm.txt drivers to make their ->remove() callbacks avoid races with runtime PM directly, · line 595

Quoted 10 lines
Documentation/power/runtime_pm.txt +4 -0
@@ -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 lore raw
Quoted 23 lines · Alan Stern
Quoted 21 lines · Krzysztof Kozlowski

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

---

Changes since v1:
1. Address Alan's comments.

---
 Documentation/power/runtime_pm.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/power/runtime_pm.txt +0 -0
index 7328cf85236c..1fd1fbe9ce95 100644
@@ -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.
 
Quoted 9 lines

Documentation/power/runtime_pm.txt drivers to make their ->remove() callbacks avoid races with runtime PM directly, · line 595

Quoted 7 lines
Documentation/power/runtime_pm.txt +4 -0
+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,

Applied, thanks!