Skip to content

Commit

Permalink
PM / Runtime: Avoid resuming devices again in pm_runtime_force_resume()
Browse files Browse the repository at this point in the history
If the runtime PM status of the device isn't RPM_SUSPENDED, prevent the
pm_runtime_force_resume() from invoking the ->runtime_resume() callback
for the device, as it's not the expected behaviour from the subsystem/driver.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Ulf Hansson authored and Rafael J. Wysocki committed Jun 16, 2016
1 parent 9b002b8 commit 9f5b527
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/base/power/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,9 @@ int pm_runtime_force_resume(struct device *dev)
goto out;
}

if (!pm_runtime_status_suspended(dev))
goto out;

ret = pm_runtime_set_active(dev);
if (ret)
goto out;
Expand Down

0 comments on commit 9f5b527

Please sign in to comment.