summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2014-11-05 10:40:07 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:12:18 -0400
commit1deb73b9c6512c6f0a296e35145c49233ea47f74 (patch)
tree0d76fb35799d6eeec0bc65860baefd3e3be1149e /drivers
parentb49903b51c8cbda42eebd733d83b8cc1e9349700 (diff)
gpu: nvgpu: clean up module deinitialization
Fix gk20a module removal so that the driver can be correctly removed when built as a module (CONFIG_GK20A=m). Reinsertion correctly will need more missing deinit calls, which are not yet implemented. This change has no effect yet on any builds since the module is built in by the defconfig. - don't free threaded irqs that are bound to the device - destroy cde if it is enabled - remove all debugfs entries recursively generated directly and by cde, pmu, clk etc. - free secure buffer if it exists - remove pm_runtime_put, since it doesn't have a pairing get - pm_runtime defines proper function stubs if it is not enabled, so remove ifdefs and query pm_runtime_enabled() - null and free gk20a only after all deinit has been done Bug 1476801 Change-Id: I73ad72832bdb501fd7071d6ac68d461ee63a760d Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/594442 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 91cd5834..ab9dd037 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -598,10 +598,7 @@ static void gk20a_remove_support(struct platform_device *dev)
598 598
599 release_firmware(g->pmu_fw); 599 release_firmware(g->pmu_fw);
600 600
601 free_irq(g->irq_stall, g); 601 /* free mappings to registers, etc */
602 free_irq(g->irq_nonstall, g);
603
604 /* free mappings to registers, etc*/
605 602
606 if (g->regs) { 603 if (g->regs) {
607 iounmap(g->regs); 604 iounmap(g->regs);
@@ -1455,6 +1452,9 @@ static int __exit gk20a_remove(struct platform_device *dev)
1455 if (platform->virtual_dev) 1452 if (platform->virtual_dev)
1456 return vgpu_remove(dev); 1453 return vgpu_remove(dev);
1457 1454
1455 if (platform->has_cde)
1456 gk20a_cde_destroy(g);
1457
1458#ifdef CONFIG_INPUT_CFBOOST 1458#ifdef CONFIG_INPUT_CFBOOST
1459 if (g->boost_added) 1459 if (g->boost_added)
1460 cfb_remove_device(&dev->dev); 1460 cfb_remove_device(&dev->dev);
@@ -1465,23 +1465,23 @@ static int __exit gk20a_remove(struct platform_device *dev)
1465 1465
1466 gk20a_user_deinit(dev); 1466 gk20a_user_deinit(dev);
1467 1467
1468 set_gk20a(dev, NULL); 1468 debugfs_remove_recursive(platform->debugfs);
1469#ifdef CONFIG_DEBUG_FS
1470 debugfs_remove(g->debugfs_ltc_enabled);
1471 debugfs_remove(g->debugfs_gr_idle_timeout_default);
1472 debugfs_remove(g->debugfs_timeouts_enabled);
1473#endif
1474 1469
1475 gk20a_remove_sysfs(&dev->dev); 1470 gk20a_remove_sysfs(&dev->dev);
1476 1471
1472 if (platform->secure_buffer.destroy)
1473 platform->secure_buffer.destroy(dev,
1474 &platform->secure_buffer);
1475
1476 if (pm_runtime_enabled(&dev->dev))
1477 pm_runtime_disable(&dev->dev);
1478 else
1479 gk20a_pm_disable_clk(&dev->dev);
1480
1481 set_gk20a(dev, NULL);
1477 kfree(g); 1482 kfree(g);
1478 1483
1479#ifdef CONFIG_PM_RUNTIME 1484 gk20a_dbg_fn("removed");
1480 pm_runtime_put(&dev->dev);
1481 pm_runtime_disable(&dev->dev);
1482#else
1483 gk20a_pm_disable_clk(&dev->dev);
1484#endif
1485 1485
1486 return 0; 1486 return 0;
1487} 1487}