From d02ae4f1e94fbeb9401bde9d34044792e213c54b Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Tue, 20 Mar 2018 12:28:04 -0700 Subject: gpu: nvgpu: handle pm suspend/resume with runtime pm disable When runtime pm is disabled, then gpu rail will be on as soon as nvgpu module is loaded. If pm suspend/resume called before gpu hw initialization(g->poweron = false) then pm suspend is skipping gpu railgate, which is causing issues with SC7 entry/exit. To fix this issue: 1. During pm suspend, if g->poweron is false, check for runtime pm disable to railgate gpu rail. 2. On pm resume, check for runtime pm disable to enable gpu rail, though gpu driver not initialized. Bug 2073029 Change-Id: I7631109d79cda5882d2864557f1b7b3d2d89c9f6 Signed-off-by: seshendra Gadagottu Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1679010 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/module.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index cebb5565..b9c9554b 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c @@ -960,8 +960,11 @@ static int gk20a_pm_suspend(struct device *dev) int ret = 0; int idle_usage_count = g->user_railgate_disabled ? 1 : 0; - if (!g->power_on) + if (!g->power_on) { + if (!pm_runtime_enabled(dev)) + gk20a_pm_railgate(dev); return 0; + } if (nvgpu_atomic_read(&g->usage_count) > idle_usage_count) return -EBUSY; @@ -983,8 +986,11 @@ static int gk20a_pm_resume(struct device *dev) struct gk20a *g = get_gk20a(dev); int ret = 0; - if (!g->suspended) + if (!g->suspended) { + if (!pm_runtime_enabled(dev)) + gk20a_pm_unrailgate(dev); return 0; + } ret = gk20a_pm_runtime_resume(dev); -- cgit v1.2.2