mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: suspend/resume support for vGPU
- Added suspend/resume power management callbacks for vGPU - Added suspend/resume commands for communication between vGPU and RM server - Added suspend/resume message parameters for IVC messages between vGPU and RM server JIRA EVLR-2305 JIRA EVLR-2306 Change-Id: I83a314b4e125a53117d16c5ea72dbc5d8ef96ef7 Signed-off-by: Deepak Bhosale <dbhosale@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1735153 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Richard Zhao <rizhao@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Nirav Patel <nipatel@nvidia.com> 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
90fc8d653f
commit
e4e2c18828
@@ -967,9 +967,15 @@ static int gk20a_pm_suspend(struct device *dev)
|
||||
int idle_usage_count = 0;
|
||||
|
||||
if (!g->power_on) {
|
||||
if (platform->suspend)
|
||||
ret = platform->suspend(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!pm_runtime_enabled(dev))
|
||||
gk20a_pm_railgate(dev);
|
||||
return 0;
|
||||
ret = gk20a_pm_railgate(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (nvgpu_atomic_read(&g->usage_count) > idle_usage_count)
|
||||
@@ -980,25 +986,41 @@ static int gk20a_pm_suspend(struct device *dev)
|
||||
return ret;
|
||||
|
||||
if (platform->suspend)
|
||||
platform->suspend(dev);
|
||||
ret = platform->suspend(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
g->suspended = true;
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int gk20a_pm_resume(struct device *dev)
|
||||
{
|
||||
struct gk20a_platform *platform = dev_get_drvdata(dev);
|
||||
struct gk20a *g = get_gk20a(dev);
|
||||
int ret = 0;
|
||||
|
||||
if (!g->suspended) {
|
||||
if (platform->resume)
|
||||
ret = platform->resume(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!pm_runtime_enabled(dev))
|
||||
gk20a_pm_unrailgate(dev);
|
||||
return 0;
|
||||
ret = gk20a_pm_unrailgate(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (platform->resume)
|
||||
ret = platform->resume(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = gk20a_pm_runtime_resume(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
g->suspended = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user