<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/Documentation/power/runtime_pm.rst, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-04-15T17:23:58Z</updated>
<entry>
<title>Documentation: PM: runtime: Fix a reference to pm_runtime_autosuspend()</title>
<updated>2025-04-15T17:23:58Z</updated>
<author>
<name>Sakari Ailus</name>
</author>
<published>2025-04-10T15:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19e8019e06b478ab04683418c73ca297d114c425'/>
<id>urn:sha1:19e8019e06b478ab04683418c73ca297d114c425</id>
<content type='text'>
pm_runtime_autosuspend() got accidentally renamed as
__pm_runtime_autosuspend() whereas the intention in the
patch was to rename pm_runtime_put_autosuspend() only.

Fix it.

Fixes: b7d46644e554 ("PM: runtime: Add pm_runtime_put_autosuspend() replacement")
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Link: https://patch.msgid.link/20250410153106.4146265-2-sakari.ailus@linux.intel.com
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Documentation: PM: Clarify pm_runtime_resume_and_get() return value</title>
<updated>2024-12-10T19:14:22Z</updated>
<author>
<name>Paul Barker</name>
</author>
<published>2024-12-03T14:37:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccb84dc8f4a02e7d30ffd388522996546b4d00e1'/>
<id>urn:sha1:ccb84dc8f4a02e7d30ffd388522996546b4d00e1</id>
<content type='text'>
Update the documentation to match the behaviour of the code.

pm_runtime_resume_and_get() always returns 0 on success, even if
__pm_runtime_resume() returns 1.

Fixes: 2c412337cfe6 ("PM: runtime: Add documentation for pm_runtime_resume_and_get()")
Signed-off-by: Paul Barker &lt;paul.barker.ct@bp.renesas.com&gt;
Link: https://patch.msgid.link/20241203143729.478-1-paul.barker.ct@bp.renesas.com
[ rjw: Subject and changelog edits, adjusted new comment formatting ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Documentation: PM: Discourage use of deprecated macros</title>
<updated>2024-09-04T12:37:57Z</updated>
<author>
<name>Andy Shevchenko</name>
</author>
<published>2024-09-03T17:25:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c62362e786f30852a13b005c2c6dafcc1537ba06'/>
<id>urn:sha1:c62362e786f30852a13b005c2c6dafcc1537ba06</id>
<content type='text'>
The Documentation refers to some deprecated macros.

Update those parts accordingly.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://patch.msgid.link/20240903172520.3568731-1-andriy.shevchenko@linux.intel.com
[ rjw: Changelog edit ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Documentation: PM: Fix runtime_pm.rst markdown syntax</title>
<updated>2024-02-29T19:16:03Z</updated>
<author>
<name>Yiwei Lin</name>
</author>
<published>2024-02-25T13:00:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e65095686441e724e5c64bf065d66e189048b4d5'/>
<id>urn:sha1:e65095686441e724e5c64bf065d66e189048b4d5</id>
<content type='text'>
The '7. Generic subsystem callbacks' should be a section title, but
the markdown syntax is not adequate now.

Fix it so the chapter can be linked at docs.kernel.org correctly.

Signed-off-by: Yiwei Lin &lt;s921975628@gmail.com&gt;
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: runtime: Add pm_runtime_put_autosuspend() replacement</title>
<updated>2024-02-12T15:57:47Z</updated>
<author>
<name>Sakari Ailus</name>
</author>
<published>2024-01-30T11:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b7d46644e554ed017dfabc0841acf418d0584bc9'/>
<id>urn:sha1:b7d46644e554ed017dfabc0841acf418d0584bc9</id>
<content type='text'>
Add __pm_runtime_put_autosuspend() that replaces
pm_runtime_put_autosuspend() for new users. The intent is to later
re-purpose pm_runtime_put_autosuspend() to also mark the device's last
busy stamp---which is what the vast majority of users actually need.

This is also described in pm_runtime_put_autosuspend() documentation.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: runtime: Simplify pm_runtime_get_if_active() usage</title>
<updated>2024-02-12T15:57:47Z</updated>
<author>
<name>Sakari Ailus</name>
</author>
<published>2024-01-30T11:28:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c0ef3df8dbaef51ee4cfd58a471adf2eaee6f6b3'/>
<id>urn:sha1:c0ef3df8dbaef51ee4cfd58a471adf2eaee6f6b3</id>
<content type='text'>
There are two ways to opportunistically increment a device's runtime PM
usage count, calling either pm_runtime_get_if_active() or
pm_runtime_get_if_in_use(). The former has an argument to tell whether to
ignore the usage count or not, and the latter simply calls the former with
ign_usage_count set to false. The other users that want to ignore the
usage_count will have to explicitly set that argument to true which is a
bit cumbersome.

To make this function more practical to use, remove the ign_usage_count
argument from the function. The main implementation is in a static
function called pm_runtime_get_conditional() and implementations of
pm_runtime_get_if_active() and pm_runtime_get_if_in_use() are moved to
runtime.c.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Takashi Iwai &lt;tiwai@suse.de&gt; # sound/
Reviewed-by: Jacek Lawrynowicz &lt;jacek.lawrynowicz@linux.intel.com&gt; # drivers/accel/ivpu/
Acked-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt; # drivers/gpu/drm/i915/
Reviewed-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt; # drivers/pci/
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: runtime: Capture device status before disabling runtime PM</title>
<updated>2021-12-17T15:16:40Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2021-12-07T18:54:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c24efa6732788f0be22cdf5d2aedd5e3117e983f'/>
<id>urn:sha1:c24efa6732788f0be22cdf5d2aedd5e3117e983f</id>
<content type='text'>
In some cases (for example, during system-wide suspend and resume of
devices) it is useful to know whether or not runtime PM has ever been
enabled for a given device and, if so, what the runtime PM status of
it had been right before runtime PM was disabled for it last time.

For this reason, introduce a new struct dev_pm_info field called
last_status that will be used for capturing the runtime PM status of
the device when its power.disable_depth counter changes from 0 to 1.

The new field will be set to RPM_INVALID to start with and whenever
power.disable_depth changes from 1 to 0, so it will be valid only
when runtime PM of the device is currently disabled, but it has been
enabled at least once.

Immediately use power.last_status in rpm_resume() to make it handle
the case when PM runtime is disabled for the device, but its runtime
PM status is RPM_ACTIVE more consistently.  Namely, make it return 1
if power.last_status is also equal to RPM_ACTIVE in that case (the
idea being that if the status was RPM_ACTIVE last time when
power.disable_depth was changing from 0 to 1 and it is still
RPM_ACTIVE, it can be assumed to reflect what happened to the device
last time when it was using runtime PM) and -EACCES otherwise.

Update the documentation to provide a description of last_status and
change the description of pm_runtime_resume() in it to reflect the
new behavior of rpm_active().

While at it, rearrange the code in pm_runtime_enable() to be more
straightforward and replace the WARN() macro in it with a pr_warn()
invocation which is less disruptive.

Link: https://lore.kernel.org/linux-pm/20211026222626.39222-1-ulf.hansson@linaro.org/t/#u
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: runtime: Clarify documentation when callbacks are unassigned</title>
<updated>2021-06-11T17:04:07Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2021-06-09T10:06:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4ec4f059088b48585c337328e05fa930c64d1ba8'/>
<id>urn:sha1:4ec4f059088b48585c337328e05fa930c64d1ba8</id>
<content type='text'>
Recent changes to the PM core allows -&gt;runtime_suspend|resume callbacks to
be unassigned.

In the earlier behaviour the PM core would return -ENOSYS, when trying to
runtime resume a device, for example. Let's update the documentation to
clarify this.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: runtime: document common mistake with pm_runtime_get_sync()</title>
<updated>2021-05-31T12:17:13Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-05-26T16:22:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c58e7ed28b4534ed073371843d03c433d6a9fe34'/>
<id>urn:sha1:c58e7ed28b4534ed073371843d03c433d6a9fe34</id>
<content type='text'>
pm_runtime_get_sync(), contradictory to intuition, does not drop the
runtime PM usage counter on errors which lead to several wrong usages in
drivers (missing the put).  pm_runtime_resume_and_get() was added as a
better implementation so document the preference of using it, hoping it
will stop bad patterns.

Suggested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
[ rjw: Documentation change edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: runtime: Add documentation for pm_runtime_resume_and_get()</title>
<updated>2021-04-09T15:24:28Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2021-04-08T15:22:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c412337cfe655bcc6adff8904fc653a1678f70f'/>
<id>urn:sha1:2c412337cfe655bcc6adff8904fc653a1678f70f</id>
<content type='text'>
Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to
deal with usage counter") added a new runtime-PM API function without
updating the documentation in runtime_pm.rst.

Add the missing documentation.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Fixes: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
