]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: bail out from poweroff if channel suspend fails
authorDeepak Nibade <dnibade@nvidia.com>
Wed, 11 Jun 2014 13:52:51 +0000 (19:22 +0530)
committerTodd Poynter <tpoynter@nvidia.com>
Thu, 19 Jun 2014 15:42:37 +0000 (08:42 -0700)
During gk20a_pm_prepare_poweroff(), if call to gk20a_channel_suspend()
fails, we proceed to disable other components and then return error.
But when genpd sees the error, it will abort the suspend sequence and
keep the device state as active.

But since we have already disabled all the components, GPU lands in
invalid state.

Hence, if channel_suspend() fails then do not proceed but return
the error immediately

Bug 200010416

Change-Id: I553a2a25832a1be4941bb6b6ce490c950cdbe7fa
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
(cherry picked from commit 7352415a206b6bec41c762085e49efec5036dec9)
Reviewed-on: http://git-master/r/426078
Reviewed-by: Todd Poynter <tpoynter@nvidia.com>
Tested-by: Todd Poynter <tpoynter@nvidia.com>
drivers/gpu/nvgpu/gk20a/gk20a.c

index 4d9ac7d0d0bb9701a85a4289806264dd78452c6c..163d394eedce75368b2553a49252549d4ba222f3 100644 (file)
@@ -763,6 +763,10 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
        if (!g->power_on)
                return 0;
 
+       ret = gk20a_channel_suspend(g);
+       if (ret)
+               return ret;
+
        /*
         * After this point, gk20a interrupts should not get
         * serviced.
@@ -773,8 +777,6 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
                g->irq_requested = false;
        }
 
-       ret |= gk20a_channel_suspend(g);
-
        /* disable elpg before gr or fifo suspend */
        ret |= gk20a_pmu_destroy(g);
        ret |= gk20a_gr_suspend(g);