blob: 175c1f0fb625465016265e5458b8db59a3a5efb4 [file] [log] [blame]
From 001ec9eae4fa8cf3deda23d6d2d853fd72934b2a Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Fri, 22 Dec 2023 10:53:00 +0800
Subject: [PATCH 069/120] mtk: wifi: mt76: mt7996: support disable muru debug
info when recording fwlog
When we record fwlog, we will also enable recording muru debug info log by
default. However, in certain test scenarios, this can result in
recording too many logs, causing inconvenience during issue analysis.
Therefore, this commit adds an debug option, fw_debug_muru_disable, in
debugfs. User can modify this option to enable/disable recording muru
debug info log.
[Usage]
Set:
$ echo val > debugfs/fw_debug_muru_disable
Get:
$ cat debugfs/fw_debug_muru_disable
val can be the following values:
0 = enable recording muru debug info (Default value)
1 = disable recording muru debug info
CR-Id: WCNCR00261410
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
---
mt7996/debugfs.c | 29 +++++++++++++++++++++++++++++
mt7996/mt7996.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/mt7996/debugfs.c b/mt7996/debugfs.c
index 7eeb5329e..5b3e39672 100644
--- a/mt7996/debugfs.c
+++ b/mt7996/debugfs.c
@@ -468,6 +468,9 @@ mt7996_fw_debug_muru_set(void *data)
} debug;
int ret;
+ if (dev->fw_debug_muru_disable)
+ return 0;
+
for (debug = DEBUG_BSRP_STATUS; debug <= DEBUG_MEC_UPDATE_AMSDU; debug++) {
ret = mt7996_mcu_muru_dbg_info(dev, debug,
dev->fw_debug_bin & BIT(0));
@@ -912,6 +915,30 @@ static const struct file_operations mt7996_efuse_ops = {
.llseek = default_llseek,
};
+static int
+mt7996_fw_debug_muru_disable_set(void *data, u64 val)
+{
+ struct mt7996_dev *dev = data;
+
+ dev->fw_debug_muru_disable = !!val;
+
+ return 0;
+}
+
+static int
+mt7996_fw_debug_muru_disable_get(void *data, u64 *val)
+{
+ struct mt7996_dev *dev = data;
+
+ *val = dev->fw_debug_muru_disable;
+
+ return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(fops_fw_debug_muru_disable,
+ mt7996_fw_debug_muru_disable_get,
+ mt7996_fw_debug_muru_disable_set, "%lld\n");
+
int mt7996_init_debugfs(struct mt7996_phy *phy)
{
struct mt7996_dev *dev = phy->dev;
@@ -948,6 +975,8 @@ int mt7996_init_debugfs(struct mt7996_phy *phy)
debugfs_create_devm_seqfile(dev->mt76.dev, "rdd_monitor", dir,
mt7996_rdd_monitor);
}
+ debugfs_create_file("fw_debug_muru_disable", 0600, dir, dev,
+ &fops_fw_debug_muru_disable);
if (phy == &dev->phy)
dev->debugfs_dir = dir;
diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h
index e64b5a1e4..a91bcf4ec 100644
--- a/mt7996/mt7996.h
+++ b/mt7996/mt7996.h
@@ -472,6 +472,7 @@ struct mt7996_dev {
u8 fw_debug_wa;
u8 fw_debug_bin;
u16 fw_debug_seq;
+ bool fw_debug_muru_disable;
struct dentry *debugfs_dir;
struct rchan *relay_fwlog;
--
2.39.2