Skip to content

Commit f1eedcf

Browse files
committed
docs: pm: Update runtime PM documentation and release notes
Add new configuration options for runtime PM to the release notes, including stack size, priority, and system work queue usage. Update the runtime PM documentation to explain the implications of using the system work queue and disabling asynchronous operations. Include a new version of the sequence diagram for asynchronous operations. Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 89ec0d4 commit f1eedcf

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

doc/releases/release-notes-4.2.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ New APIs and options
139139

140140
* :kconfig:option:`CONFIG_MQTT_VERSION_5_0`
141141

142+
* Power management
143+
144+
* :kconfig:option:`CONFIG_PM_DEVICE_RUNTIME_WQ_STACK_SIZE`
145+
* :kconfig:option:`CONFIG_PM_DEVICE_RUNTIME_WQ_PRIO`
146+
* :kconfig:option:`CONFIG_PM_DEVICE_RUNTIME_WQ_INIT_PRIO`
147+
* :kconfig:option:`CONFIG_PM_DEVICE_RUNTIME_USE_SYSTEM_WQ`
148+
* :kconfig:option:`CONFIG_PM_DEVICE_RUNTIME_ASYNC`
149+
142150
* Stepper
143151

144152
* :c:func:`stepper_stop()`

doc/services/pm/device_runtime.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,24 @@ be a problem if the operation is fast, e.g. a register toggle. However, the
107107
situation will not be the same if suspension involves sending packets through a
108108
slow bus. For this reason the device drivers can also make use of the
109109
:c:func:`pm_device_runtime_put_async` function. This function will schedule
110-
the suspend operation, again, if device is no longer used. The suspension will
111-
then be carried out when the system work queue gets the chance to run. The
112-
sequence diagram shown below illustrates this scenario.
110+
the suspend operation, again, if device is no longer used.
111+
112+
By default, the operation is offloaded to the PM subsystem’s work
113+
queue. However, applications can configure the runtime PM to use the
114+
system work queue instead selecting
115+
:kconfig:option:`CONFIG_PM_DEVICE_RUNTIME_USE_SYSTEM_WQ`. This choice
116+
comes with a caveat: when using the system work queue, device drivers
117+
must not perform any blocking operations during suspend, as this could
118+
stall the system work queue. If blocking behavior is needed—for
119+
example, accessing a slow peripheral or waiting on a bus
120+
transaction—the PM subsystem work queue must be used to avoid
121+
impacting system responsiveness.
122+
123+
For targets with constrained resources that do not need asynchronous
124+
operations, this functionality can be disabled altogether by
125+
de-selecting :kconfig:option:`PM_DEVICE_RUNTIME_ASYNC`, reducing
126+
memory usage and system complexity.
127+
113128

114129
.. figure:: images/devr-async-ops.svg
115130

0 commit comments

Comments
 (0)