Skip to content

Commit 4d7fddd

Browse files
rafaeljwgregkh
authored andcommitted
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 <[email protected]> Cc: stable <[email protected]> Reviewed-by: Sudeep Holla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ba61d68 commit 4d7fddd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

include/linux/device.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,9 @@ static inline bool device_pm_not_required(struct device *dev)
851851
static inline void device_set_pm_not_required(struct device *dev)
852852
{
853853
dev->power.no_pm = true;
854+
#ifdef CONFIG_PM
855+
dev->power.no_callbacks = true;
856+
#endif
854857
}
855858

856859
static inline void dev_pm_syscore_device(struct device *dev, bool val)

0 commit comments

Comments
 (0)