gpu: nvgpu: set nvgpu power state to POWERED_OFF on poweron fail

When force closing the app, poweron needed in channel close path will
fail as pg_task kthread creation fails with -EINTR (process is
SIGKILL'd so threads don't get created).

Upon poweron failure, device nodes are removed and the nvgpu power
state is not reset to NVGPU_STATE_POWERED_OFF. Hence on further
gk20a_busy attempts, poweron is not attempted and gpu remains
unusable from thereon.

Change the state to POWERED_OFF from POWERING_ON on poweron fail.

Bug 3308828

Change-Id: I2360f11a4937dfe93eb7933b30c13748fb570898
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2543797
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sagar Kamble
2021-06-14 18:22:07 +05:30
committed by mobile promotions
parent 8f9ac1dea9
commit e0e337fb83

View File

@@ -544,6 +544,7 @@ done:
if (l->dev_nodes_created) { if (l->dev_nodes_created) {
gk20a_user_nodes_deinit(dev); gk20a_user_nodes_deinit(dev);
} }
nvgpu_set_power_state(g, NVGPU_STATE_POWERED_OFF);
} }
nvgpu_mutex_release(&g->power_lock); nvgpu_mutex_release(&g->power_lock);