diff options
| author | Rafael J. Wysocki <[email protected]> | 2019-02-07 18:38:56 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2019-02-08 10:26:14 +0000 |
| commit | 4080ab083000a1e9656b0d1607e238e7001e0c84 (patch) | |
| tree | eac34432ee6a46348a1a41bc277df934ef71aa19 /fs/kernfs/kernfs-internal.h | |
| parent | device.h: Add __cold to dev_<level> logging functions (diff) | |
| download | kernel-4080ab083000a1e9656b0d1607e238e7001e0c84.tar.gz kernel-4080ab083000a1e9656b0d1607e238e7001e0c84.zip | |
PM-runtime: Take suppliers into account in __pm_runtime_set_status()
If the target device has any suppliers, as reflected by device links
to them, __pm_runtime_set_status() does not take them into account,
which is not consistent with the other parts of the PM-runtime
framework and may lead to programming mistakes.
Modify __pm_runtime_set_status() to take suppliers into account by
activating them upfront if the new status is RPM_ACTIVE and
deactivating them on exit if the new status is RPM_SUSPENDED.
If the activation of one of the suppliers fails, the new status
will be RPM_SUSPENDED and the (remaining) suppliers will be
deactivated on exit (the child count of the device's parent
will be dropped too then).
Of course, adding device links locking to __pm_runtime_set_status()
means that it cannot be run fron interrupt context, so make it use
spin_lock_irq() and spin_unlock_irq() instead of spin_lock_irqsave()
and spin_unlock_irqrestore(), respectively.
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'fs/kernfs/kernfs-internal.h')
0 files changed, 0 insertions, 0 deletions
