gpu: nvgpu: Allow SC7 suspend/resume

Allow SC7 suspend/resume for platforms even if runtime pm
is disabled.

Currently, nvgpu can disable runtime pm by setting railgate_init
field to false for platform_{gk20a/gv11b/ga10b) files. This is done by
taking extra reference count in the PM Framework.

However, device suspend would still fail. Fix this by checking
for NVGPU_CAN_RAILGATE and removing the additional reference count
taken as mentioned above. Take the extra refcount back at
the end of the resume path.

Bug 3458643

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I413e09e2f9f380d78c0ce30196591e9c5b7544f3
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2668567
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Debarshi Dutta
2022-02-11 14:19:26 +05:30
committed by mobile promotions
parent 830d5994d0
commit cb70e86ac1

View File

@@ -1432,6 +1432,16 @@ static int gk20a_pm_suspend(struct device *dev)
goto fail_idle;
}
/* For cases where we don't have railgate enabled,
* we acquire an extra refcount in PM framework.
*
* Release it here to unblock device suspend.
* The below method releases the extra refcount taken
* above and disables auto suspend.
*/
if (!nvgpu_is_enabled(g, NVGPU_CAN_RAILGATE))
pm_runtime_dont_use_autosuspend(dev);
ret = gk20a_pm_runtime_suspend(dev);
if (ret)
goto fail_idle;
@@ -1479,6 +1489,15 @@ static int gk20a_pm_resume(struct device *dev)
if (ret)
return ret;
/* For cases where we don't have railgate enabled,
* acquire extra reference in PM framework to prevent
* runtime suspend/resume.
*/
if (!nvgpu_is_enabled(g, NVGPU_CAN_RAILGATE)) {
pm_runtime_set_autosuspend_delay(dev, -1);
pm_runtime_use_autosuspend(dev);
}
g->suspended = false;
nvgpu_channel_deterministic_unidle(g);