gpu: nvgpu: reset pm status on runtime_resume fail

If an error occurs during an attempt to perform a runtime_resume,
the runtime power management framework sets an error flag that
prevents further attempts to resume until the error is cleared.
nvgpu currently does not clear the flag, which causes nvgpu to
lock up if an error occurs during runtime_resume.

This change explicitly sets the device pm status to suspended
on error, which clears the error flag so that subsequent attempts
to resume will not be blocked.

Bug 200324790

Change-Id: I3c875453670d3691ab01cff90ce31e797296662a
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1526478
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Sunny He
2017-07-25 11:31:27 -07:00
committed by mobile promotions
parent d59271c7b7
commit 83096af727

View File

@@ -81,8 +81,11 @@ int gk20a_busy(struct gk20a *g)
dev = dev_from_gk20a(g); dev = dev_from_gk20a(g);
if (pm_runtime_enabled(dev)) { if (pm_runtime_enabled(dev)) {
/* Increment usage count and attempt to resume device */
ret = pm_runtime_get_sync(dev); ret = pm_runtime_get_sync(dev);
if (ret < 0) { if (ret < 0) {
/* Mark suspended so runtime pm will retry later */
pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev); pm_runtime_put_noidle(dev);
atomic_dec(&g->usage_count); atomic_dec(&g->usage_count);
goto fail; goto fail;