]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: Disable pm runtime on shutdown
authorArto Merilainen <amerilainen@nvidia.com>
Tue, 20 May 2014 09:47:20 +0000 (12:47 +0300)
committerRiham Haidar <rhaidar@nvidia.com>
Wed, 21 May 2014 18:42:49 +0000 (11:42 -0700)
In some cases the gpu has still work pending while the device is
being suspended. This patch forces pm runtime to be disabled for
the device to avoid powering up the gpu unnecessarily.

Bug 1515437

Change-Id: I4b57d72eb34e794f0457d7a074d26c9d096a13b3
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/411968
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>
drivers/gpu/nvgpu/gk20a/gk20a.c

index 2e4064744254ee65d570a1155d76caf9387dda13..db018cb25ea1a6397a156e84b6baea082cc981ae 100644 (file)
@@ -1158,6 +1158,12 @@ static int gk20a_pm_disable_clk(struct device *dev)
        return 0;
 }
 
+static void gk20a_pm_shutdown(struct platform_device *pdev)
+{
+       dev_info(&pdev->dev, "shutting down");
+       __pm_runtime_disable(&pdev->dev, false);
+}
+
 #ifdef CONFIG_PM
 const struct dev_pm_ops gk20a_pm_ops = {
 #if defined(CONFIG_PM_RUNTIME) && !defined(CONFIG_PM_GENERIC_DOMAINS)
@@ -1476,6 +1482,7 @@ static int __exit gk20a_remove(struct platform_device *dev)
 static struct platform_driver gk20a_driver = {
        .probe = gk20a_probe,
        .remove = __exit_p(gk20a_remove),
+       .shutdown = gk20a_pm_shutdown,
        .driver = {
                .owner = THIS_MODULE,
                .name = "gk20a",