PM / sleep: make PM notifiers called symmetrically
This makes pm notifier PREPARE/POST symmetrical: if PREPARE fails, we will only undo what ever happened on PREPARE. It fixes the unbalanced CPU hotplug enable in CPU PM notifier. Signed-off-by: Lianwei Wang <lianwei.wang@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
ca5f2b4c4f
commit
ea00f4f4f0
@@ -38,12 +38,19 @@ int unregister_pm_notifier(struct notifier_block *nb)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(unregister_pm_notifier);
|
||||
|
||||
int pm_notifier_call_chain(unsigned long val)
|
||||
int __pm_notifier_call_chain(unsigned long val, int nr_to_call, int *nr_calls)
|
||||
{
|
||||
int ret = blocking_notifier_call_chain(&pm_chain_head, val, NULL);
|
||||
int ret;
|
||||
|
||||
ret = __blocking_notifier_call_chain(&pm_chain_head, val, NULL,
|
||||
nr_to_call, nr_calls);
|
||||
|
||||
return notifier_to_errno(ret);
|
||||
}
|
||||
int pm_notifier_call_chain(unsigned long val)
|
||||
{
|
||||
return __pm_notifier_call_chain(val, -1, NULL);
|
||||
}
|
||||
|
||||
/* If set, devices may be suspended and resumed asynchronously. */
|
||||
int pm_async_enabled = 1;
|
||||
|
Reference in New Issue
Block a user