dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] drm: Clean up debugfs upon shutdown
@ 2013-07-07 19:02 Chris Wilson
  2013-07-07 19:02 ` [PATCH 2/8] drm/i915: Remove redundant debugfs cleanup Chris Wilson
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Chris Wilson @ 2013-07-07 19:02 UTC (permalink / raw)
  To: dri-devel; +Cc: Dave Airlie

Driver authors are a forgetful breed, and having to manually clean up
all inodes from debugfs during module unload is tedious and rarely
encountered by users; leftover inodes fester. But behold, the drm core
already tracks all inodes created under the DRI debugfs minor so that we
can do all the teardown ourselves.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_debugfs.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index a05087c..b855fd7 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -229,7 +229,16 @@ int drm_debugfs_cleanup(struct drm_minor *minor)
 	if (dev->driver->debugfs_cleanup)
 		dev->driver->debugfs_cleanup(minor);
 
-	drm_debugfs_remove_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor);
+	while (!list_empty(&minor->debugfs_list)) {
+		struct drm_info_node *node =
+			list_first_entry(&minor->debugfs_list,
+					 struct drm_info_node,
+					 list);
+
+		debugfs_remove(node->dent);
+		list_del(&node->list);
+		kfree(node);
+	}
 
 	debugfs_remove(minor->debugfs_root);
 	minor->debugfs_root = NULL;
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-07-08 20:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-07 19:02 [PATCH 1/8] drm: Clean up debugfs upon shutdown Chris Wilson
2013-07-07 19:02 ` [PATCH 2/8] drm/i915: Remove redundant debugfs cleanup Chris Wilson
2013-07-07 19:02 ` [PATCH 3/8] drm/nouveau: " Chris Wilson
2013-07-07 19:02 ` [PATCH 4/8] drm/omap: " Chris Wilson
2013-07-07 23:40   ` Rob Clark
2013-07-07 19:02 ` [PATCH 5/8] drm/qxl: " Chris Wilson
2013-07-07 19:02 ` [PATCH 6/8] drm/radeon: " Chris Wilson
2013-07-07 19:02 ` [PATCH 7/8] drm/tiledc: " Chris Wilson
2013-07-07 23:40   ` Rob Clark
2013-07-07 19:02 ` [PATCH 8/8] drm: Remove debugfs_cleanup callback from drivers Chris Wilson
2013-07-08 20:21   ` Daniel Vetter
2013-07-07 23:39 ` [PATCH 1/8] drm: Clean up debugfs upon shutdown Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox