diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2018-02-07 16:26:11 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-02-09 11:51:39 -0500 |
commit | 244a124ce2ae5daa10283f3129843a72bc36676e (patch) | |
tree | 57fdefd5ea79603e182fad6e6ab085aeaf6074dd /drivers/gpu/nvgpu/common | |
parent | cb54d7ca8f7d9d99780ce1f82e0f7253a8556571 (diff) |
gpu: nvgpu: handle pm_prepare_poweroff failure
As part of gk20a_pm_prepare_poweroff, gpu hw state
is destroyed even in case of any errors. So try to recover
from that situation by calling gk20a_pm_finalize_poweron.
Bug 200380708
Change-Id: Ibff656cda67241ad111fd22701e05871f20d6f70
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1653750
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index 814f2fc9..67dfeff3 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -928,23 +928,25 @@ fail: | |||
928 | static int gk20a_pm_runtime_suspend(struct device *dev) | 928 | static int gk20a_pm_runtime_suspend(struct device *dev) |
929 | { | 929 | { |
930 | int err = 0; | 930 | int err = 0; |
931 | struct gk20a *g = get_gk20a(dev); | ||
931 | 932 | ||
932 | if (gk20a_gpu_is_virtual(dev)) | 933 | if (gk20a_gpu_is_virtual(dev)) |
933 | err = vgpu_pm_prepare_poweroff(dev); | 934 | err = vgpu_pm_prepare_poweroff(dev); |
934 | else | 935 | else |
935 | err = gk20a_pm_prepare_poweroff(dev); | 936 | err = gk20a_pm_prepare_poweroff(dev); |
936 | if (err) | 937 | if (err) { |
938 | nvgpu_err(g, "failed to power off, err=%d", err); | ||
937 | goto fail; | 939 | goto fail; |
940 | } | ||
938 | 941 | ||
939 | err = gk20a_pm_railgate(dev); | 942 | err = gk20a_pm_railgate(dev); |
940 | if (err) | 943 | if (err) |
941 | goto fail_railgate; | 944 | goto fail; |
942 | 945 | ||
943 | return 0; | 946 | return 0; |
944 | 947 | ||
945 | fail_railgate: | ||
946 | gk20a_pm_finalize_poweron(dev); | ||
947 | fail: | 948 | fail: |
949 | gk20a_pm_finalize_poweron(dev); | ||
948 | pm_runtime_mark_last_busy(dev); | 950 | pm_runtime_mark_last_busy(dev); |
949 | return err; | 951 | return err; |
950 | } | 952 | } |