Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: ti: knav_qmss: remove debugfs file on teardown
@ 2026-06-15  9:12 Pengpeng Hou
  2026-06-29 13:12 ` Nishanth Menon
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-06-15  9:12 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar, linux-kernel, linux-arm-kernel
  Cc: Pengpeng Hou

knav_queue_probe() creates the global qmss debugfs file whose show
callback reads the global kdev state. knav_queue_remove() disables
runtime PM but leaves the debugfs file and ready state published.

Save the debugfs dentry, remove it during teardown, and clear the global
ready pointer state.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/soc/ti/knav_qmss_queue.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 86d7a9c9ae01..1cc2e4a90c0d 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -26,6 +26,7 @@
 #include "knav_qmss.h"
 
 static struct knav_device *kdev;
+static struct dentry *knav_queue_debugfs;
 static DEFINE_MUTEX(knav_dev_lock);
 #define knav_dev_lock_held() \
 	lockdep_is_held(&knav_dev_lock)
@@ -1857,8 +1858,9 @@ static int knav_queue_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL,
-			    &knav_queue_debug_fops);
+	knav_queue_debugfs = debugfs_create_file("qmss", 0444,
+						 NULL, NULL,
+						 &knav_queue_debug_fops);
 	device_ready = true;
 	return 0;
 
@@ -1873,9 +1875,14 @@ static int knav_queue_probe(struct platform_device *pdev)
 
 static void knav_queue_remove(struct platform_device *pdev)
 {
+	device_ready = false;
+	debugfs_remove(knav_queue_debugfs);
+	knav_queue_debugfs = NULL;
+
 	/* TODO: Free resources */
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
+	kdev = NULL;
 }
 
 static struct platform_driver keystone_qmss_driver = {
-- 
2.50.1 (Apple Git-155)



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

end of thread, other threads:[~2026-06-29 13:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15  9:12 [PATCH] soc: ti: knav_qmss: remove debugfs file on teardown Pengpeng Hou
2026-06-29 13:12 ` Nishanth Menon

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