Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Feb 2025 14:52:59 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0735e8ddc328 - stable/14 - rtw88/rtw89: avoid duplicate top-level directory with debugfs
Message-ID:  <202502101452.51AEqxGu028552@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=0735e8ddc3284765a7e35a2d2f83a6ce1faff2c7

commit 0735e8ddc3284765a7e35a2d2f83a6ce1faff2c7
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-01-25 23:55:53 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-02-10 14:52:11 +0000

    rtw88/rtw89: avoid duplicate top-level directory with debugfs
    
    If people like me having multiple cards in the same system
    creating the debugfs dirctory leads to a panic upon attaching
    the 2nd card due to the duplicate name.
    Rather than using the hard coded driver name, use the device name
    (e.g., rtw880, rtw881, rtw882).
    This solves two issues: it avoids the duplicate name and we get
    individual debugging/statistic information for each card.
    
    Sponsored by:   The FreeBSD Foundation
    X-Note:         ath1[01]k and mt76 likely will need a similar change
    
    (cherry picked from commit b4886c4ece3e692c294aa853da7aec849f8d00a2)
---
 sys/contrib/dev/rtw88/debug.c | 4 ++++
 sys/contrib/dev/rtw89/debug.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/sys/contrib/dev/rtw88/debug.c b/sys/contrib/dev/rtw88/debug.c
index e84f25b34c46..1373633d73ee 100644
--- a/sys/contrib/dev/rtw88/debug.c
+++ b/sys/contrib/dev/rtw88/debug.c
@@ -1223,7 +1223,11 @@ void rtw_debugfs_init(struct rtw_dev *rtwdev)
 {
 	struct dentry *debugfs_topdir;
 
+#if defined(__linux__)
 	debugfs_topdir = debugfs_create_dir("rtw88",
+#elif defined(__FreeBSD__)
+	debugfs_topdir = debugfs_create_dir(dev_name(rtwdev->dev),
+#endif
 					    rtwdev->hw->wiphy->debugfsdir);
 	rtw_debugfs_add_w(write_reg);
 	rtw_debugfs_add_rw(read_reg);
diff --git a/sys/contrib/dev/rtw89/debug.c b/sys/contrib/dev/rtw89/debug.c
index 750ef1578e18..a87f4b49829d 100644
--- a/sys/contrib/dev/rtw89/debug.c
+++ b/sys/contrib/dev/rtw89/debug.c
@@ -3974,7 +3974,11 @@ void rtw89_debugfs_init(struct rtw89_dev *rtwdev)
 {
 	struct dentry *debugfs_topdir;
 
+#if defined(__linux__)
 	debugfs_topdir = debugfs_create_dir("rtw89",
+#elif defined(__FreeBSD__)
+	debugfs_topdir = debugfs_create_dir(dev_name(rtwdev->dev),
+#endif
 					    rtwdev->hw->wiphy->debugfsdir);
 
 	rtw89_debugfs_add_rw(read_reg);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502101452.51AEqxGu028552>