* [PATCH] dmaengine: pl330: remove debugfs file on teardown
@ 2026-06-15 9:16 Pengpeng Hou
2026-07-02 16:03 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-06-15 9:16 UTC (permalink / raw)
To: Vinod Koul, Frank Li, dmaengine, linux-kernel; +Cc: Pengpeng Hou
init_pl330_debugfs() creates a debugfs file with struct pl330_dmac as
private data. pl330_remove() then unregisters the DMA device and frees
the PL330 channel/thread state without removing that file.
Keep the debugfs dentry and remove it before tearing down the DMAC state
used by the debugfs show callback.
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/dma/pl330.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 25ba84b18704..6214d9000db8 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -502,6 +502,7 @@ struct pl330_dmac {
struct dma_pl330_chan *peripherals; /* keep at end */
int quirks;
+ struct dentry *dbgfs;
struct reset_control *rstc;
struct reset_control *rstc_ocp;
};
@@ -2952,14 +2953,24 @@ DEFINE_SHOW_ATTRIBUTE(pl330_debugfs);
static inline void init_pl330_debugfs(struct pl330_dmac *pl330)
{
- debugfs_create_file(dev_name(pl330->ddma.dev),
- S_IFREG | 0444, NULL, pl330,
- &pl330_debugfs_fops);
+ pl330->dbgfs = debugfs_create_file(dev_name(pl330->ddma.dev),
+ S_IFREG | 0444, NULL, pl330,
+ &pl330_debugfs_fops);
+}
+
+static inline void deinit_pl330_debugfs(struct pl330_dmac *pl330)
+{
+ debugfs_remove(pl330->dbgfs);
+ pl330->dbgfs = NULL;
}
#else
static inline void init_pl330_debugfs(struct pl330_dmac *pl330)
{
}
+
+static inline void deinit_pl330_debugfs(struct pl330_dmac *pl330)
+{
+}
#endif
/*
@@ -3204,6 +3215,8 @@ static void pl330_remove(struct amba_device *adev)
struct dma_pl330_chan *pch, *_p;
int i, irq;
+ deinit_pl330_debugfs(pl330);
+
pm_runtime_get_noresume(pl330->ddma.dev);
if (adev->dev.of_node)
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: pl330: remove debugfs file on teardown
2026-06-15 9:16 [PATCH] dmaengine: pl330: remove debugfs file on teardown Pengpeng Hou
@ 2026-07-02 16:03 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2026-07-02 16:03 UTC (permalink / raw)
To: Frank Li, dmaengine, linux-kernel, Pengpeng Hou
On Mon, 15 Jun 2026 17:16:45 +0800, Pengpeng Hou wrote:
> init_pl330_debugfs() creates a debugfs file with struct pl330_dmac as
> private data. pl330_remove() then unregisters the DMA device and frees
> the PL330 channel/thread state without removing that file.
>
> Keep the debugfs dentry and remove it before tearing down the DMAC state
> used by the debugfs show callback.
>
> [...]
Applied, thanks!
[1/1] dmaengine: pl330: remove debugfs file on teardown
commit: 0d3e3376b289cdaff5b3b6c1581999926ff1000f
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-02 16:03 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:16 [PATCH] dmaengine: pl330: remove debugfs file on teardown Pengpeng Hou
2026-07-02 16:03 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox