From 4942cc4222ef2049f5596b87ae9007123cdcdedb Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 17 Jan 2017 12:40:52 +0530 Subject: gpu: nvgpu: wait for idle in shutdown In gk20a_pm_shutdown(), we currently do not wait for IOCTLs or threads in progress and directly proceed with shutdown sequence This can cause random hangs during system shutdown Fix this by calling gk20a_wait_for_idle() after we disable runtime PM in gk20a_pm_shutdown() Bug 200260926 Change-Id: I0f06ba9232263fcb09c6e9d246be89deec053d44 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1286522 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index f2094bfa..5f365d4b 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1390,6 +1390,8 @@ static void gk20a_pm_shutdown(struct platform_device *pdev) /* Prevent more requests by disabling Runtime PM */ __pm_runtime_disable(&pdev->dev, false); + gk20a_wait_for_idle(&pdev->dev); + /* Be ready for rail-gate after this point */ if (gk20a_gpu_is_virtual(&pdev->dev)) vgpu_pm_prepare_poweroff(&pdev->dev); -- cgit v1.2.2