From c284516ead33708e135eeaa53672d835849f25fb Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 12 Oct 2016 15:14:15 +0530 Subject: gpu: nvgpu: support suspend/resume with user disabled railgating We take an extra power refcount when we disable railgating through railgate_enable sysfs And that breaks suspend/resume since we check for power refcount first in gk20a_pm_suspend() Fix this with following : - set a flag user_railgate_disabled when User disables railgating through sysfs railgate_enable - in gk20a_pm_suspend(), drop one power refcount if flag is set - in gk20a_pm_resume(), take one refcount again if flag is set Fix __gk20a_do_idle() to consider this extra refcount as well. Add new variable target_ref_cnt and use it instead of assuming target refcount of 1 In case User has disabled rail gating, set this target refcount as 2 Also, export gk20a_idle_nosuspend() which drop power refcount without triggering suspend Bug 200233570 Change-Id: Ic0e35c73eb74ffefea1cd90d1b152650d9d2043d Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1236047 (cherry picked from commit 6e002d57da4b5c58ed79889728bb678d3aa1f1b1) Reviewed-on: http://git-master/r/1235219 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 8e0072de..d51fdea1 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1174,6 +1174,7 @@ void gk20a_remove_sysfs(struct device *dev); #define GK20A_SIM_IORESOURCE_MEM 2 void gk20a_busy_noresume(struct device *dev); +void gk20a_idle_nosuspend(struct device *dev); int __must_check gk20a_busy(struct device *dev); void gk20a_idle(struct device *dev); void gk20a_disable(struct gk20a *g, u32 units); -- cgit v1.2.2