From e99a3dec3a7ac903c20b6843693d53087fb7bcab Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Fri, 3 Feb 2017 14:47:02 -0800 Subject: gpu: nvgpu: Disable IRQs only if enabled In the PCI init/de-init code only disable IRQs if they were enabled. The enable happens in the common power_on code. The PCI routines could both be called without the common power_on code being called which causes an extra disable to happen. Bug 200275531 Change-Id: I43a8a9881f1e9ae254bf36230f29849df074657f Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1301701 (cherry picked from commit cca70e9adccee1ef65a0a6d95a4494fc87500c17) Reviewed-on: http://git-master/r/1298954 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 1 + drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + drivers/gpu/nvgpu/pci.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 91c82104..79c3fd09 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1098,6 +1098,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) enable_irq(g->irq_stall); if (g->irq_stall != g->irq_nonstall) enable_irq(g->irq_nonstall); + g->irqs_enabled = 1; if (g->ops.xve.available_speeds) { u32 speed; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 196af3c1..31b02378 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -990,6 +990,7 @@ struct gk20a { struct gpu_ops ops; + int irqs_enabled; int irq_stall; /* can be same as irq_nonstall in case of PCI */ int irq_nonstall; u32 max_ltc_count; diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c index a81090a2..3677b02d 100644 --- a/drivers/gpu/nvgpu/pci.c +++ b/drivers/gpu/nvgpu/pci.c @@ -439,7 +439,9 @@ static void nvgpu_pci_remove(struct pci_dev *pdev) gk20a_dbg(gpu_dbg_shutdown, "Removing nvgpu driver!\n"); gk20a_driver_start_unload(g); - disable_irq(g->irq_stall); + if (g->irqs_enabled) + disable_irq(g->irq_stall); + devm_free_irq(&pdev->dev, g->irq_stall, g); #if defined(CONFIG_PCI_MSI) -- cgit v1.2.2