diff options
author | Deepak Bhosale <dbhosale@nvidia.com> | 2018-05-30 16:12:24 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-06-21 16:56:50 -0400 |
commit | e4e2c1882865163ad53eeaf96acf83802ffbec71 (patch) | |
tree | e433b02a198e6c943397da13c792ba75d0c285a2 /drivers/gpu/nvgpu/os/linux/module.c | |
parent | 90fc8d653fba60a6f7b96e7d91ff02361a3a4890 (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/module.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index af71cc81..4516490b 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c | |||
@@ -967,9 +967,15 @@ static int gk20a_pm_suspend(struct device *dev) | |||
967 | int idle_usage_count = 0; | 967 | int idle_usage_count = 0; |
968 | 968 | ||
969 | if (!g->power_on) { | 969 | if (!g->power_on) { |
970 | if (platform->suspend) | ||
971 | ret = platform->suspend(dev); | ||
972 | if (ret) | ||
973 | return ret; | ||
974 | |||
970 | if (!pm_runtime_enabled(dev)) | 975 | if (!pm_runtime_enabled(dev)) |
971 | gk20a_pm_railgate(dev); | 976 | ret = gk20a_pm_railgate(dev); |
972 | return 0; | 977 | |
978 | return ret; | ||
973 | } | 979 | } |
974 | 980 | ||
975 | if (nvgpu_atomic_read(&g->usage_count) > idle_usage_count) | 981 | if (nvgpu_atomic_read(&g->usage_count) > idle_usage_count) |
@@ -980,25 +986,41 @@ static int gk20a_pm_suspend(struct device *dev) | |||
980 | return ret; | 986 | return ret; |
981 | 987 | ||
982 | if (platform->suspend) | 988 | if (platform->suspend) |
983 | platform->suspend(dev); | 989 | ret = platform->suspend(dev); |
990 | if (ret) | ||
991 | return ret; | ||
984 | 992 | ||
985 | g->suspended = true; | 993 | g->suspended = true; |
986 | 994 | ||
987 | return 0; | 995 | return ret; |
988 | } | 996 | } |
989 | 997 | ||
990 | static int gk20a_pm_resume(struct device *dev) | 998 | static int gk20a_pm_resume(struct device *dev) |
991 | { | 999 | { |
1000 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
992 | struct gk20a *g = get_gk20a(dev); | 1001 | struct gk20a *g = get_gk20a(dev); |
993 | int ret = 0; | 1002 | int ret = 0; |
994 | 1003 | ||
995 | if (!g->suspended) { | 1004 | if (!g->suspended) { |
1005 | if (platform->resume) | ||
1006 | ret = platform->resume(dev); | ||
1007 | if (ret) | ||
1008 | return ret; | ||
1009 | |||
996 | if (!pm_runtime_enabled(dev)) | 1010 | if (!pm_runtime_enabled(dev)) |
997 | gk20a_pm_unrailgate(dev); | 1011 | ret = gk20a_pm_unrailgate(dev); |
998 | return 0; | 1012 | |
1013 | return ret; | ||
999 | } | 1014 | } |
1000 | 1015 | ||
1016 | if (platform->resume) | ||
1017 | ret = platform->resume(dev); | ||
1018 | if (ret) | ||
1019 | return ret; | ||
1020 | |||
1001 | ret = gk20a_pm_runtime_resume(dev); | 1021 | ret = gk20a_pm_runtime_resume(dev); |
1022 | if (ret) | ||
1023 | return ret; | ||
1002 | 1024 | ||
1003 | g->suspended = false; | 1025 | g->suspended = false; |
1004 | 1026 | ||