From 3899f3b997b2d770e6689cde938a359f28172c27 Mon Sep 17 00:00:00 2001 From: Santosh Katvate Date: Fri, 16 May 2014 01:09:51 +0530 Subject: gpu: nvgpu: Turn off scaling when not powered This far the scaling has been disabled only when we suspend the system and therefore we unnecessarily keep gpu workers running even if the gpu itself would be railgated. This is not proper behaviour and it causes a race in suspend sequence. This patch reorders scaling disable to happen always when we turn off the GPU. Bug 200004860 Change-Id: Ief0bfd89378d5a7ced26c3ef29094dd5c378b01a Signed-off-by: Santosh Katvate Reviewed-on: http://git-master/r/410443 (cherry picked from commit bcae65bea24be2a1e0abe42522d99ba70c94cbe2) Reviewed-on: http://git-master/r/413249 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 db018cb2..19880da4 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -747,6 +747,8 @@ static int gk20a_pm_prepare_poweroff(struct device *dev) gk20a_dbg_fn(""); + gk20a_scale_suspend(to_platform_device(dev)); + if (!g->power_on) return 0; @@ -1205,8 +1207,6 @@ static int gk20a_pm_suspend(struct device *dev) if (atomic_read(&dev->power.usage_count) > 1) return -EBUSY; - gk20a_scale_suspend(to_platform_device(dev)); - ret = gk20a_pm_prepare_poweroff(dev); if (ret) return ret; -- cgit v1.2.2