video: tegra: host: gk20a: reorder free_irq
Prashant Malani [Fri, 24 Jan 2014 20:08:05 +0000 (12:08 -0800)]
Free IRQs before the various subunits are suspended. This is to prevent
potential races between the IRQ thread and the suspend routine.

Bug 1437749

Change-Id: I835f20a54d177f4b30a66e0dcb41c8240e5c97fd
Signed-off-by: Prashant Malani <pmalani@nvidia.com>
Reviewed-on: http://git-master/r/359990
(cherry picked from commit a37ca473bdddc664aa1049b5c4ce965052ec8441)
Reviewed-on: http://git-master/r/362026
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Eric Brower <ebrower@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/video/tegra/host/gk20a/gk20a.c

index 7ab95f2..6a17914 100644 (file)
@@ -770,14 +770,6 @@ int nvhost_gk20a_prepare_poweroff(struct platform_device *dev)
        if (!g->power_on)
                return 0;
 
-       ret |= gk20a_channel_suspend(g);
-
-       /* disable elpg before gr or fifo suspend */
-       ret |= gk20a_pmu_destroy(g);
-       ret |= gk20a_gr_suspend(g);
-       ret |= gk20a_mm_suspend(g);
-       ret |= gk20a_fifo_suspend(g);
-
        /*
         * After this point, gk20a interrupts should not get
         * serviced.
@@ -788,6 +780,14 @@ int nvhost_gk20a_prepare_poweroff(struct platform_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);
+       ret |= gk20a_mm_suspend(g);
+       ret |= gk20a_fifo_suspend(g);
+
        /* Disable GPCPLL */
        ret |= gk20a_suspend_clk_support(g);
        g->power_on = false;