From e0e337fb830f26aa188f55b1f2e0cdc55cb5208a Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Mon, 14 Jun 2021 18:22:07 +0530 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2543797 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 0d76f1704..333a33a2a 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -544,6 +544,7 @@ done: if (l->dev_nodes_created) { gk20a_user_nodes_deinit(dev); } + nvgpu_set_power_state(g, NVGPU_STATE_POWERED_OFF); } nvgpu_mutex_release(&g->power_lock);