Skip to contentSkip to conversation

net: stmmac: create one debugfs dir per net-device

PATCH Applied Mathieu Olivari 2 participants 2 messages May 23, 2015 – May 25, 2015

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

PATCH 1/1 net: stmmac: create one debugfs dir per net-device

stmmac DebugFS entries are currently global to the driver. As a result, having more than one stmmac device in the system creates the following error:
* ERROR stmmaceth, debugfs create directory failed
* stmmac_hw_setup: failed debugFS registration

This also results in being able to access the debugfs information for the first registered device only.

This patch changes the debugfs structure to have one sub-directory per net-device. Files under "/sys/kernel/debug/stmmaceth" will now show-up under /sys/kernel/debug/stmmaceth/ethN/.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      |  6 ++
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 76 ++++++++++++++++-------
 2 files changed, 59 insertions(+), 23 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac.h +6 -0
index 9cbcae2..1f3b33a 100644
@@ -125,6 +125,12 @@ struct stmmac_priv {
 	int use_riwt;
 	int irq_wake;
 	spinlock_t ptp_lock;
+
+#ifdef CONFIG_DEBUG_FS
+	struct dentry *dbgfs_dir;
+	struct dentry *dbgfs_rings_status;
+	struct dentry *dbgfs_dma_cap;
+#endif
 };
 
 int stmmac_mdio_unregister(struct net_device *ndev);
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +53 -23

128 lines not on this page · raw message

Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw

From: Mathieu Olivari <[email protected]>
Date: Fri, 22 May 2015 19:03:29 -0700

Quoted 6 lines

stmmac DebugFS entries are currently global to the driver. As a result, having more than one stmmac device in the system creates the following error:
* ERROR stmmaceth, debugfs create directory failed
* stmmac_hw_setup: failed debugFS registration

Quoted 8 lines

This also results in being able to access the debugfs information for the first registered device only.

This patch changes the debugfs structure to have one sub-directory per net-device. Files under "/sys/kernel/debug/stmmaceth" will now show-up under /sys/kernel/debug/stmmaceth/ethN/.

Applied, thank you.