From: Chin-Yen Lee <[email protected]>
The coming dump function for FW malfunction will add a function to
dump registers to reflect status. However, if we are not debugging
the mechanism, we don't print anything, so avoid reading registers by
checking debug mask to reduce IO.
Signed-off-by: Chin-Yen Lee <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
---
drivers/net/wireless/realtek/rtw88/debug.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/debug.h b/drivers/net/wireless/realtek/rtw88/debug.h
index a9149c6c2b48..a03ced11bbe0 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.h
+++ b/drivers/net/wireless/realtek/rtw88/debug.h
@@ -48,11 +48,23 @@ void __rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask,
#define rtw_dbg(rtwdev, a...) __rtw_dbg(rtwdev, ##a)
+static inline bool rtw_dbg_is_enabled(struct rtw_dev *rtwdev,
+ enum rtw_debug_mask mask)
+{
+ return !!(rtw_debug_mask & mask);
+}
+
#else
static inline void rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask,
const char *fmt, ...) {}
+static inline bool rtw_dbg_is_enabled(struct rtw_dev *rtwdev,
+ enum rtw_debug_mask mask)
+{
+ return false;
+}
+
#endif /* CONFIG_RTW88_DEBUG */
#define rtw_info(rtwdev, a...) dev_info(rtwdev->dev, ##a)
--
2.25.1
Ping-Ke Shih <[email protected]> wrote:
> From: Chin-Yen Lee <[email protected]>
>
> The coming dump function for FW malfunction will add a function to
> dump registers to reflect status. However, if we are not debugging
> the mechanism, we don't print anything, so avoid reading registers by
> checking debug mask to reduce IO.
>
> Signed-off-by: Chin-Yen Lee <[email protected]>
> Signed-off-by: Ping-Ke Shih <[email protected]>
2 patches applied to wireless-next.git, thanks.
1926a27299db wifi: rtw88: debug: add to check if debug mask is enabled
20907fc06997 wifi: rtw88: dump firmware debug information in abnormal state
--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches