From 0dd7ffbf2367fa892a0730a8264077e79fd1b18c Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 12 Jan 2016 17:49:57 +0530 Subject: gpu: nvgpu: remove wait in shutdown In gk20a_pm_shutdown(), we currently wait for 2s for all channels to finish their work But we already cancel all the nvgpu workers, freeze user processes during shutdown So the waiting should not be required, and hence remove it Bug 200166139 Change-Id: I0012f1b3c0f4f676958d083f8c60a001f7015fb0 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1121918 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 7b0db89e..dd27ef64 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1155,26 +1155,23 @@ static int gk20a_pm_disable_clk(struct device *dev) static void gk20a_pm_shutdown(struct platform_device *pdev) { + struct gk20a_platform *platform = platform_get_drvdata(pdev); + + dev_info(&pdev->dev, "shutting down"); + + /* If GPU is already railgated, + * just prevent more requests, and return */ + if (platform->is_railgated && platform->is_railgated(&pdev->dev)) { #ifdef CONFIG_PM - unsigned long timeout = jiffies + - msecs_to_jiffies(GK20A_WAIT_FOR_IDLE_MS); - int ref_cnt; + __pm_runtime_disable(&pdev->dev, false); #endif + return; + } - dev_info(&pdev->dev, "shutting down"); #ifdef CONFIG_PM /* Prevent more requests by disabling Runtime PM */ __pm_runtime_disable(&pdev->dev, false); - - /* Wait until current running requests are finished */ - while (time_before(jiffies, timeout)) { - ref_cnt = atomic_read(&pdev->dev.power.usage_count); - if (ref_cnt > 1) - msleep(1); - else - break; - } #endif /* Be ready for rail-gate after this point */ @@ -1182,6 +1179,8 @@ static void gk20a_pm_shutdown(struct platform_device *pdev) vgpu_pm_prepare_poweroff(&pdev->dev); else gk20a_pm_prepare_poweroff(&pdev->dev); + + dev_info(&pdev->dev, "shut down complete\n"); } #ifdef CONFIG_PM -- cgit v1.2.2