mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
947b37bcf0
commit
d02ae4f1e9
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user