Skip to contentSkip to conversation

media: rockchip: rkisp1: use device name for debugfs subdir name

PATCH In review Mikhail Rudenko 3 participants 4 messages Oct 10, 2021 – Nov 13, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: rockchip: rkisp1: use device name for debugfs subdir name

While testing Rockchip RK3399 with both ISPs enabled, a dmesg error was observed:

```
[   15.559141] debugfs: Directory 'rkisp1' with parent '/' already present!
```

Fix it by using the device name for the debugfs subdirectory name instead of the driver name, thus preventing name collision.

---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +1 -1
index 7474150b94ed..560f928c3752 100644
@@ -426,7 +426,7 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
 {
 	struct rkisp1_debug *debug = &rkisp1->debug;
 
-	debug->debugfs_dir = debugfs_create_dir(RKISP1_DRIVER_NAME, NULL);
+	debug->debugfs_dir = debugfs_create_dir(dev_name(rkisp1->dev), NULL);
 	debugfs_create_ulong("data_loss", 0444, debug->debugfs_dir,
 			     &debug->data_loss);
 	debugfs_create_ulong("outform_size_err", 0444,  debug->debugfs_dir,
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mikhail Rudenko

While testing Rockchip RK3399 with both ISPs enabled, a dmesg error was observed:

```
[   15.559141] debugfs: Directory 'rkisp1' with parent '/' already present!
```

Fix it by using the device name for the debugfs subdirectory name instead of the driver name, thus preventing name collision.

Thanks!

Quoted 20 lines
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +1 -1
index 7474150b94ed..560f928c3752 100644
@@ -426,7 +426,7 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
 {
 	struct rkisp1_debug *debug = &rkisp1->debug;
 
-	debug->debugfs_dir = debugfs_create_dir(RKISP1_DRIVER_NAME, NULL);
+	debug->debugfs_dir = debugfs_create_dir(dev_name(rkisp1->dev), NULL);
 	debugfs_create_ulong("data_loss", 0444, debug->debugfs_dir,
 			     &debug->data_loss);
 	debugfs_create_ulong("outform_size_err", 0444,  debug->debugfs_dir,
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Mikhail Rudenko

Hi Mikhail,

Quoting Mikhail Rudenko (2021-10-10 18:54:57)

Quoted 19 lines

While testing Rockchip RK3399 with both ISPs enabled, a dmesg error was observed:

```
[   15.559141] debugfs: Directory 'rkisp1' with parent '/' already present!
```

Fix it by using the device name for the debugfs subdirectory name instead of the driver name, thus preventing name collision.

---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +0 -0
index 7474150b94ed..560f928c3752 100644

drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c static void rkisp1_debug_init(struct rkisp1_device *rkisp1) · line 429

Quoted 5 lines
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +1 -1
@@ -426,7 +426,7 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
 {
        struct rkisp1_debug *debug = &rkisp1->debug;
 
-       debug->debugfs_dir = debugfs_create_dir(RKISP1_DRIVER_NAME, NULL);
+       debug->debugfs_dir = debugfs_create_dir(dev_name(rkisp1->dev), NULL);

I would wonder if they should be grouped under a subdir called rkisp1 ... but that would then still keep the same issue that whichever was second to probe would find that /rkisp1 was already present. I suspect debugfs would make it possible to check if the parent was already there and only create it if it exists, but anyway, it would then be harder to clean up too.

So separate based on the nodes sounds perfectly reasonable to me.

Quoted 6 lines
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +0 -0
        debugfs_create_ulong("data_loss", 0444, debug->debugfs_dir,
                             &debug->data_loss);
        debugfs_create_ulong("outform_size_err", 0444,  debug->debugfs_dir,
Signature · 1 line
2.33.0
#3 lore raw
In reply to Mikhail Rudenko
Quoted 19 lines · Mikhail Rudenko

While testing Rockchip RK3399 with both ISPs enabled, a dmesg error was observed:

```
[   15.559141] debugfs: Directory 'rkisp1' with parent '/' already present!
```

Fix it by using the device name for the debugfs subdirectory name instead of the driver name, thus preventing name collision.

---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +0 -0
index 7474150b94ed..560f928c3752 100644

drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c static void rkisp1_debug_init(struct rkisp1_device *rkisp1) · line 432

Quoted 8 lines
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +1 -1
@@ -426,7 +426,7 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
 {
 	struct rkisp1_debug *debug = &rkisp1->debug;
 
-	debug->debugfs_dir = debugfs_create_dir(RKISP1_DRIVER_NAME, NULL);
+	debug->debugfs_dir = debugfs_create_dir(dev_name(rkisp1->dev), NULL);
 	debugfs_create_ulong("data_loss", 0444, debug->debugfs_dir,
 			     &debug->data_loss);
 	debugfs_create_ulong("outform_size_err", 0444,  debug->debugfs_dir,

Gentle ping. Could this be merged please?

--
Best regards,
Mikhail Rudenko

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip