From: Ping-Ke Shih pkshih@realtek.com
[ Upstream commit 09489812013f9ff3850c3af9900c88012b8c1e5d ]
The newer firmware, like RTL8852C version 0.27.111.0, will notify driver report of TAS (Time Averaged SAR) power by new C2H events. This is to assist in higher accurate calculation of TAS.
For now, driver doesn't use the report yet, so add a dummy handler to avoid it throws info like: rtw89_8852ce 0000:03:00.0: c2h class 9 func 6 not support
Also add "MAC" and "PHY" to the message to disambiguate the source of C2H event.
Signed-off-by: Ping-Ke Shih pkshih@realtek.com Link: https://patch.msgid.link/20241209042127.21424-1-pkshih@realtek.com Signed-off-by: Zenm Chen zenmchen@gmail.com --- Currently the rtw89 driver in kernel 6.12.y could spam the system log with the messages below if the distro provides a newer firmware, backport this patch to 6.12.y to fix it.
[ 13.207637] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 17.115171] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 19.117996] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 21.122162] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 23.123588] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 25.127008] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 31.246591] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 34.665080] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 41.064308] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 43.067127] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 45.069878] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 47.072845] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 49.265599] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 51.268512] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 53.271490] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support [ 55.274271] rtw89_8852ce 0000:02:00.0: c2h class 9 func 6 not support
--- drivers/net/wireless/realtek/rtw89/mac.c | 4 ++-- drivers/net/wireless/realtek/rtw89/phy.c | 10 ++++++++-- drivers/net/wireless/realtek/rtw89/phy.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c index 9b09d4b7d..2188bca89 100644 --- a/drivers/net/wireless/realtek/rtw89/mac.c +++ b/drivers/net/wireless/realtek/rtw89/mac.c @@ -5513,11 +5513,11 @@ void rtw89_mac_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb, case RTW89_MAC_C2H_CLASS_FWDBG: return; default: - rtw89_info(rtwdev, "c2h class %d not support\n", class); + rtw89_info(rtwdev, "MAC c2h class %d not support\n", class); return; } if (!handler) { - rtw89_info(rtwdev, "c2h class %d func %d not support\n", class, + rtw89_info(rtwdev, "MAC c2h class %d func %d not support\n", class, func); return; } diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index 5c31639b4..355c3f58a 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -3062,10 +3062,16 @@ rtw89_phy_c2h_rfk_report_state(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u3 (int)(len - sizeof(report->hdr)), &report->state); }
+static void +rtw89_phy_c2h_rfk_log_tas_pwr(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len) +{ +} + static void (* const rtw89_phy_c2h_rfk_report_handler[])(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len) = { [RTW89_PHY_C2H_RFK_REPORT_FUNC_STATE] = rtw89_phy_c2h_rfk_report_state, + [RTW89_PHY_C2H_RFK_LOG_TAS_PWR] = rtw89_phy_c2h_rfk_log_tas_pwr, };
bool rtw89_phy_c2h_chk_atomic(struct rtw89_dev *rtwdev, u8 class, u8 func) @@ -3119,11 +3125,11 @@ void rtw89_phy_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb, return; fallthrough; default: - rtw89_info(rtwdev, "c2h class %d not support\n", class); + rtw89_info(rtwdev, "PHY c2h class %d not support\n", class); return; } if (!handler) { - rtw89_info(rtwdev, "c2h class %d func %d not support\n", class, + rtw89_info(rtwdev, "PHY c2h class %d func %d not support\n", class, func); return; } diff --git a/drivers/net/wireless/realtek/rtw89/phy.h b/drivers/net/wireless/realtek/rtw89/phy.h index 9bb9c9c8e..961a4bacb 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.h +++ b/drivers/net/wireless/realtek/rtw89/phy.h @@ -151,6 +151,7 @@ enum rtw89_phy_c2h_rfk_log_func {
enum rtw89_phy_c2h_rfk_report_func { RTW89_PHY_C2H_RFK_REPORT_FUNC_STATE = 0, + RTW89_PHY_C2H_RFK_LOG_TAS_PWR = 6, };
enum rtw89_phy_c2h_dm_func {