[PATCH v2 6/8] PM: runtime: Clarify driver callback expectations and structure Section 2
From: Brian Norris
Date: Wed Sep 23 2026 - 13:50:32 EST
Section 2 describes the three runtime callbacks, but:
1) it's fairly dense to read (150+ lines); and
2) it glosses over a big point -- that it's uncommon for drivers to
implement ->runtime_idle()
Add a note up-front to help direct the reader about #2, and add headings
to try to break up the text a bit.
Signed-off-by: Brian Norris <briannorris@xxxxxxxxxxxx>
---
(no changes since v1)
Documentation/power/runtime_pm.rst | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst
index 423287fce34a..e0c20132dabd 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -54,6 +54,14 @@ There are three device runtime PM callbacks defined in 'struct dev_pm_ops'::
...
};
+Most device drivers only need to implement ->runtime_suspend() and
+->runtime_resume(). The ->runtime_idle() callback is optional and rarely
+implemented by peripheral device drivers, as the PM core automatically handles
+suspension and autosuspend when ->runtime_idle() is omitted (or returns 0).
+
+Subsystem and Driver Callbacks
+------------------------------
+
The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks
are executed by the PM core for the device's subsystem that may be either of
the following:
@@ -87,6 +95,9 @@ not block or sleep, but it also means that the synchronous helper functions
listed at the end of `Section 4`_ may be used for that device within an
interrupt handler or generally in an atomic context.
+Callback Semantics
+------------------
+
The subsystem-level suspend callback, if present, is _entirely_ _responsible_
for handling the suspend of the device as appropriate, which may, but need not
include executing the device driver's own ->runtime_suspend() callback (from the
@@ -167,6 +178,9 @@ return a non-zero value (typically -EBUSY or -EAGAIN). Unlike
return codes from ->runtime_idle() as a fatal device error; any non-zero value
simply stops the PM core from suspending the device.
+Core Guarantees and Synchronization Rules
+-----------------------------------------
+
The helper functions provided by the PM core, described in `Section 4`_,
guarantee that the following constraints are met with respect to runtime PM
callbacks for one device:
--
2.56.0.rc1.310.g51773c2048-goog