summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-10-12 05:44:15 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-18 14:08:01 -0400
commitc284516ead33708e135eeaa53672d835849f25fb (patch)
treee7ca4a1c6402f50bd1e783b78c00d92848dfc5e8 /drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
parent8b051f34fc10caa7309c0ae964fbc708d6a679a2 (diff)
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 <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1236047 (cherry picked from commit 6e002d57da4b5c58ed79889728bb678d3aa1f1b1) Reviewed-on: http://git-master/r/1235219 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
index 875a99ce..a79ec201 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
@@ -294,12 +294,14 @@ static ssize_t railgate_enable_store(struct device *dev,
294 /* release extra ref count */ 294 /* release extra ref count */
295 gk20a_idle(dev); 295 gk20a_idle(dev);
296 platform->can_railgate = true; 296 platform->can_railgate = true;
297 platform->user_railgate_disabled = false;
297 } else if (railgate_enable == 0 && platform->can_railgate) { 298 } else if (railgate_enable == 0 && platform->can_railgate) {
298 /* take extra ref count */ 299 /* take extra ref count */
299 err = gk20a_busy(dev); 300 err = gk20a_busy(dev);
300 if (err) 301 if (err)
301 return err; 302 return err;
302 platform->can_railgate = false; 303 platform->can_railgate = false;
304 platform->user_railgate_disabled = true;
303 } 305 }
304 if (err) 306 if (err)
305 return err; 307 return err;