summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/module.c
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2018-03-20 15:28:04 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-02 19:05:54 -0400
commitd02ae4f1e94fbeb9401bde9d34044792e213c54b (patch)
treef4050b1c65d26d1997a27c4bf7679b05a6e994d9 /drivers/gpu/nvgpu/common/linux/module.c
parent947b37bcf085e531afdead647d50314af29a6baa (diff)
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 <sgadagottu@nvidia.com> Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1679010 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c10
1 files changed, 8 insertions, 2 deletions
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)
960 int ret = 0; 960 int ret = 0;
961 int idle_usage_count = g->user_railgate_disabled ? 1 : 0; 961 int idle_usage_count = g->user_railgate_disabled ? 1 : 0;
962 962
963 if (!g->power_on) 963 if (!g->power_on) {
964 if (!pm_runtime_enabled(dev))
965 gk20a_pm_railgate(dev);
964 return 0; 966 return 0;
967 }
965 968
966 if (nvgpu_atomic_read(&g->usage_count) > idle_usage_count) 969 if (nvgpu_atomic_read(&g->usage_count) > idle_usage_count)
967 return -EBUSY; 970 return -EBUSY;
@@ -983,8 +986,11 @@ static int gk20a_pm_resume(struct device *dev)
983 struct gk20a *g = get_gk20a(dev); 986 struct gk20a *g = get_gk20a(dev);
984 int ret = 0; 987 int ret = 0;
985 988
986 if (!g->suspended) 989 if (!g->suspended) {
990 if (!pm_runtime_enabled(dev))
991 gk20a_pm_unrailgate(dev);
987 return 0; 992 return 0;
993 }
988 994
989 ret = gk20a_pm_runtime_resume(dev); 995 ret = gk20a_pm_runtime_resume(dev);
990 996