diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-02-07 19:38:56 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-08 11:26:14 +0100 |
commit | 4080ab083000a1e9656b0d1607e238e7001e0c84 (patch) | |
tree | eac34432ee6a46348a1a41bc277df934ef71aa19 /drivers/irqchip/irq-ls-scfg-msi.c | |
parent | 79a4e91d1bb2a411a4ce2baa93680fa707567003 (diff) |
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 <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/irqchip/irq-ls-scfg-msi.c')
0 files changed, 0 insertions, 0 deletions