From 270a962c540522bceddbbc41a055b52a65dec489 Mon Sep 17 00:00:00 2001 From: Arto Merilainen Date: Tue, 20 May 2014 12:47:20 +0300 Subject: gpu: nvgpu: Disable pm runtime on shutdown 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 Reviewed-on: http://git-master/r/411968 Reviewed-by: Riham Haidar Tested-by: Riham Haidar --- drivers/gpu/nvgpu/gk20a/gk20a.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 2e406474..db018cb2 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -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", -- cgit v1.2.2