mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
PM / Runtime: Fix error path in pm_runtime_force_resume()
As pm_runtime_set_active() may fail because the device's parent isn't
active, we can end up executing the ->runtime_resume() callback for the
device when it isn't allowed.
Fix this by invoking pm_runtime_set_active() before running the callback
and let's also deal with the error code.
Fixes: 37f204164d (PM: Add pm_runtime_suspend|resume_force functions)
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Cc: 3.15+ <[email protected]> # 3.15+
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
16669befb0
commit
0ae3aeefab
1 changed files with 7 additions and 2 deletions
|
|
@ -1506,11 +1506,16 @@ int pm_runtime_force_resume(struct device *dev)
|
|||
goto out;
|
||||
}
|
||||
|
||||
ret = callback(dev);
|
||||
ret = pm_runtime_set_active(dev);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
pm_runtime_set_active(dev);
|
||||
ret = callback(dev);
|
||||
if (ret) {
|
||||
pm_runtime_set_suspended(dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
out:
|
||||
pm_runtime_enable(dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue