Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

driver core/PM: Set power.no_callbacks along with power.no_pm

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>

authored by

Rafael J. Wysocki and committed by
Greg Kroah-Hartman
c2ce2453 1ad92645

+3
+3
include/linux/device.h
··· 851 851 static inline void device_set_pm_not_required(struct device *dev) 852 852 { 853 853 dev->power.no_pm = true; 854 + #ifdef CONFIG_PM 855 + dev->power.no_callbacks = true; 856 + #endif 854 857 } 855 858 856 859 static inline void dev_pm_syscore_device(struct device *dev, bool val)