]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
driver core/PM: Set power.no_callbacks along with power.no_pm
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 28 Aug 2025 10:59:24 +0000 (12:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:24 +0000 (11:56 +0200)
commit040a5685e13c9ad9e5041a1d84bd698774699b88
treea73fdad08d6a7cf5e8ff41ed75babe0affd0e47d
parent0a6415cd6883ccac58c37cedf2580b869b879c39
driver core/PM: Set power.no_callbacks along with power.no_pm

commit c2ce2453413d429e302659abc5ace634e873f6f5 upstream.

Devices with power.no_pm set are not expected to need any power
management at all, so modify device_set_pm_not_required() to set
power.no_callbacks for them too in case runtime PM will be enabled
for any of them (which in principle may be done for convenience if
such a device participates in a dependency chain).

Since device_set_pm_not_required() must be called before device_add()
or it would not have any effect, it can update power.no_callbacks
without locking, unlike pm_runtime_no_callbacks() that can be called
after registering the target device.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: stable <stable@kernel.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/1950054.tdWV9SEqCh@rafael.j.wysocki
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/device.h