<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/base/power/main.c, 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-06-19T13:40:41Z</updated>
<entry>
<title>PM: sleep: Fix power.is_suspended cleanup for direct-complete devices</title>
<updated>2025-06-19T13:40:41Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2025-06-03T16:19:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c7d216830d49952fc849bd5363ae1b029c3a1e0e'/>
<id>urn:sha1:c7d216830d49952fc849bd5363ae1b029c3a1e0e</id>
<content type='text'>
[ Upstream commit d46c4c839c20a599a0eb8d73708ce401f9c7d06d ]

Commit 03f1444016b7 ("PM: sleep: Fix handling devices with direct_complete
set on errors") caused power.is_suspended to be set for devices with
power.direct_complete set, but it forgot to ensure the clearing of that
flag for them in device_resume(), so power.is_suspended is still set for
them during the next system suspend-resume cycle.

If that cycle is aborted in dpm_suspend(), the subsequent invocation of
dpm_resume() will trigger a device_resume() call for every device and
because power.is_suspended is set for the devices in question, they will
not be skipped by device_resume() as expected which causes scary error
messages to be logged (as appropriate).

To address this issue, move the clearing of power.is_suspended in
device_resume() immediately after the power.is_suspended check so it
will be always cleared for all devices processed by that function.

Fixes: 03f1444016b7 ("PM: sleep: Fix handling devices with direct_complete set on errors")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4280
Reported-and-tested-by: Chris Bainbridge &lt;chris.bainbridge@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Link: https://patch.msgid.link/4990586.GXAFRqVoOG@rjwysocki.net
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Switch/rename to timer_delete[_sync]()</title>
<updated>2025-04-05T08:30:12Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2025-04-05T08:17:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8fa7292fee5c5240402371ea89ab285ec856c916'/>
<id>urn:sha1:8fa7292fee5c5240402371ea89ab285ec856c916</id>
<content type='text'>
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
over and remove the historical wrapper inlines.

Conversion was done with coccinelle plus manual fixups where necessary.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>PM: sleep: Fix bit masking operation</title>
<updated>2025-03-22T13:55:08Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2025-03-19T11:43:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3860cbe239639503e56bd4365c6bf4cb957ef04e'/>
<id>urn:sha1:3860cbe239639503e56bd4365c6bf4cb957ef04e</id>
<content type='text'>
The mask operation link-&gt;flags | DL_FLAG_PM_RUNTIME is always true which
is incorrect. The mask operation should be using the bit-wise &amp;
operator. Fix this.

Fixes: bca84a7b93fd ("PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally")
Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Link: https://patch.msgid.link/20250319114324.791829-1-colin.i.king@gmail.com
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: sleep: Fix handling devices with direct_complete set on errors</title>
<updated>2025-03-14T13:02:14Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2025-03-13T16:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03f1444016b71feffa1dfb8a51f15ba592f94b13'/>
<id>urn:sha1:03f1444016b71feffa1dfb8a51f15ba592f94b13</id>
<content type='text'>
When dpm_suspend() fails, some devices with power.direct_complete set
may not have been handled by device_suspend() yet, so runtime PM has
not been disabled for them yet even though power.direct_complete is set.

Since device_resume() expects that runtime PM has been disabled for all
devices with power.direct_complete set, it will attempt to reenable
runtime PM for the devices that have not been processed by device_suspend()
which does not make sense.  Had those devices had runtime PM disabled
before device_suspend() had run, device_resume() would have inadvertently
enable runtime PM for them, but this is not expected to happen because
it would require -&gt;prepare() callbacks to return positive values for
devices with runtime PM disabled, which would be invalid.

In practice, this issue is most likely benign because pm_runtime_enable()
will not allow the "disable depth" counter to underflow, but it causes a
warning message to be printed for each affected device.

To allow device_resume() to distinguish the "direct complete" devices
that have been processed by device_suspend() from those which have not
been handled by it, make device_suspend() set power.is_suspended for
"direct complete" devices.

Next, move the power.is_suspended check in device_resume() before the
power.direct_complete check in it to make it skip the "direct complete"
devices that have not been handled by device_suspend().

This change is based on a preliminary patch from Saravana Kannan.

Fixes: aae4518b3124 ("PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily")
Link: https://lore.kernel.org/linux-pm/20241114220921.2529905-2-saravanak@google.com/
Reported-by: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://patch.msgid.link/12627587.O9o76ZdvQC@rjwysocki.net
</content>
</entry>
<entry>
<title>PM: sleep: core: Fix indentation in dpm_wait_for_children()</title>
<updated>2025-03-12T20:18:09Z</updated>
<author>
<name>Geert Uytterhoeven</name>
</author>
<published>2025-03-12T10:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=956af869a2b7a1ab1f67bf8a74c51897f6f6715d'/>
<id>urn:sha1:956af869a2b7a1ab1f67bf8a74c51897f6f6715d</id>
<content type='text'>
The body of dpm_wait_for_children() is indented by 7 spaces instead of a
single TAB.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://patch.msgid.link/9c8ff2b103c3ba7b0d27bdc8248b05e3b1dc9551.1741776430.git.geert+renesas@glider.be
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: sleep: Rearrange dpm_async_fn() and async state clearing</title>
<updated>2025-03-03T13:38:51Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2025-02-25T16:39:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=628ccd80529223c19d22e06086be6dd87d064e0c'/>
<id>urn:sha1:628ccd80529223c19d22e06086be6dd87d064e0c</id>
<content type='text'>
In preparation for subsequent changes, move the power.completion
reinitialization along with clearing power.work_in_progress into a
separate function called dpm_clear_async_state() and rearrange
dpm_async_fn() to get rid of unnecessary indentation.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://patch.msgid.link/8494650.T7Z3S40VBb@rjwysocki.net
</content>
</entry>
<entry>
<title>PM: sleep: Rename power.async_in_progress to power.work_in_progress</title>
<updated>2025-03-03T13:38:02Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2025-02-25T16:38:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3038b22bc098565b93cfb3cc8933b89701feb407'/>
<id>urn:sha1:3038b22bc098565b93cfb3cc8933b89701feb407</id>
<content type='text'>
Rename the async_in_progress field in struct dev_pm_info to
work_in_progress as after subsequent changes it will mean work in
general rather than just async work.

No functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://patch.msgid.link/3338693.aeNJFYEL58@rjwysocki.net
</content>
</entry>
<entry>
<title>PM: core: Tweak pm_runtime_block_if_disabled() return value</title>
<updated>2025-03-03T13:35:07Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2025-02-27T10:49:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a84c2a885bc62a61e08fbcd9976a2a40400470c0'/>
<id>urn:sha1:a84c2a885bc62a61e08fbcd9976a2a40400470c0</id>
<content type='text'>
Modify pm_runtime_block_if_disabled() to return true when runtime PM
is disabled for the device, regardless of the power.last_status value.

This effectively prevents "smart suspend" from being enabled for
devices with runtime PM disabled in device_prepare(), even transiently,
so update the related comment in that function accordingly.

If a device has runtime PM disabled in device_prepare(), it is not
actually known whether or not runtime PM will be enabled for that
device going forward, so it is more appropriate to postpone the
"smart suspend" optimization for the device in the given system
suspend-resume cycle than to enable it and get confused going
forward.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://patch.msgid.link/13718674.uLZWGnKmhe@rjwysocki.net
</content>
</entry>
<entry>
<title>PM: sleep: Update power.smart_suspend under PM spinlock</title>
<updated>2025-03-03T13:35:07Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2025-02-27T10:45:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb88c229fe77ea16cef2b9c8154cf44d331818a6'/>
<id>urn:sha1:cb88c229fe77ea16cef2b9c8154cf44d331818a6</id>
<content type='text'>
Put the update of the power.smart_suspend device flag under the PM
spinlock of the device in case multiple bit fields in struct dev_pm_info
occupy one memory location which needs to be updated via RMW every time
any of these bit fields is updated.

The lock in question is already held around the power.direct_complete
flag update in device_prepare() for the same reason, so this change does
not add locking-related overhead to the code.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://patch.msgid.link/2368159.ElGaqSPkdT@rjwysocki.net
</content>
</entry>
<entry>
<title>PM: sleep: Adjust check before setting power.must_resume</title>
<updated>2025-03-03T13:31:47Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2025-02-27T10:53:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eeb87d17aceab7803a5a5bcb6cf2817b745157cf'/>
<id>urn:sha1:eeb87d17aceab7803a5a5bcb6cf2817b745157cf</id>
<content type='text'>
The check before setting power.must_resume in device_suspend_noirq()
does not take power.child_count into account, but it should do that, so
use pm_runtime_need_not_resume() in it for this purpose and adjust the
comment next to it accordingly.

Fixes: 107d47b2b95e ("PM: sleep: core: Simplify the SMART_SUSPEND flag handling")
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://patch.msgid.link/3353728.44csPzL39Z@rjwysocki.net
</content>
</entry>
</feed>
