wifi: rtw89: only print once for unknown C2H events
Ping-Ke Shih
maintainercover wifi: rtw89: only print once for unknown C2H events
The unknown C2H events are printed once driver receives, causing thousands of messages. Since this is only for developers who must implement the handlers during development, to print once is enough to be a hint. Also, to avoid somehow missing to implement causes messages to users.
Ping-Ke Shih (2):
wifi: rtw89: print just once for unknown C2H events
wifi: rtw89: add dummy C2H handlers for BCN resend and update done
drivers/net/wireless/realtek/rtw89/debug.h | 1 + drivers/net/wireless/realtek/rtw89/mac.c | 20 +++++++++++++++----- drivers/net/wireless/realtek/rtw89/mac.h | 1 + drivers/net/wireless/realtek/rtw89/phy.c | 7 +++---- 4 files changed, 20 insertions(+), 9 deletions(-)
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH 1/2 wifi: rtw89: print just once for unknown C2H events
When driver receives new or unknown C2H events, it print out messages repeatedly once events are received, like
rtw89_8922ae 0000:81:00.0: PHY c2h class 2 not support
To avoid the thousands of messages, use rtw89_info_once() instead. Also, print out class/func for unknown (undefined) class.
--- drivers/net/wireless/realtek/rtw89/debug.h | 1 + drivers/net/wireless/realtek/rtw89/mac.c | 7 +++---- drivers/net/wireless/realtek/rtw89/phy.c | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-)
drivers/net/wireless/realtek/rtw89/debug.h +1 -0
@@ -56,6 +56,7 @@ static inline void rtw89_debugfs_deinit(struct rtw89_dev *rtwdev) {}#endif #define rtw89_info(rtwdev, a...) dev_info((rtwdev)->dev, ##a) +#define rtw89_info_once(rtwdev, a...) dev_info_once((rtwdev)->dev, ##a) #define rtw89_warn(rtwdev, a...) dev_warn((rtwdev)->dev, ##a) #define rtw89_err(rtwdev, a...) dev_err((rtwdev)->dev, ##a)
drivers/net/wireless/realtek/rtw89/mac.c +3 -4
@@ -5813,12 +5813,11 @@ void rtw89_mac_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb,case RTW89_MAC_C2H_CLASS_ROLE :return ;default : -rtw89_info (rtwdev,"MAC c2h class %d not support\n" , class); -return ; +break ; }if (!handler) { -rtw89_info (rtwdev,"MAC c2h class %d func %d not support\n" , class, - func); +rtw89_info_once (rtwdev,"MAC c2h class %d func %d not support\n" , + class, func);return ; }handler (rtwdev, skb, len);
drivers/net/wireless/realtek/rtw89/phy.c +3 -4
@@ -3626,12 +3626,11 @@ void rtw89_phy_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb, handler = rtw89_phy_c2h_dm_handler[func];break ;default : -rtw89_info (rtwdev,"PHY c2h class %d not support\n" , class); -return ; +break ; }if (!handler) { -rtw89_info (rtwdev,"PHY c2h class %d func %d not support\n" , class, - func); +rtw89_info_once (rtwdev,"PHY c2h class %d func %d not support\n" , + class, func);return ; }handler (rtwdev, skb, len);
Signature · 1 line
2.25.1
Re: [PATCH rtw-next 1/2] wifi: rtw89: print just once for unknown C2H events
Quoted 59 lines · Ping-Ke Shih
When driver receives new or unknown C2H events, it print out messages repeatedly once events are received, like
rtw89_8922ae0000:81:00.0: PHY c2h class 2 not supportTo avoid the thousands of messages, use
rtw89_info_once()instead. Also, print out class/func for unknown (undefined) class.Reported-by Sean Anderson <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>--- drivers/net/wireless/realtek/rtw89/debug.h | 1 + drivers/net/wireless/realtek/rtw89/mac.c | 7 +++---- drivers/net/wireless/realtek/rtw89/phy.c | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-)drivers/net/wireless/realtek/rtw89/debug.h +1
-0@@ -56,6 +56,7 @@ static inline void rtw89_debugfs_deinit(struct rtw89_dev *rtwdev) {}#endif #define rtw89_info(rtwdev, a...) dev_info((rtwdev)->dev, ##a) +#define rtw89_info_once(rtwdev, a...) dev_info_once((rtwdev)->dev, ##a) #define rtw89_warn(rtwdev, a...) dev_warn((rtwdev)->dev, ##a) #define rtw89_err(rtwdev, a...) dev_err((rtwdev)->dev, ##a)drivers/net/wireless/realtek/rtw89/mac.c +3
-4@@ -5813,12 +5813,11 @@ void rtw89_mac_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb,case RTW89_MAC_C2H_CLASS_ROLE :return ;default : -rtw89_info (rtwdev,"MAC c2h class %d not support\n" , class); -return ; +break ; }if (!handler) { -rtw89_info (rtwdev,"MAC c2h class %d func %d not support\n" , class, - func); +rtw89_info_once (rtwdev,"MAC c2h class %d func %d not support\n" , + class, func);return ; }handler (rtwdev, skb, len);drivers/net/wireless/realtek/rtw89/phy.c +0
-2@@ -3626,12 +3626,11 @@ void rtw89_phy_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb, handler = rtw89_phy_c2h_dm_handler[func];break ;default : -rtw89_info (rtwdev,"PHY c2h class %d not support\n" , class); -return ;
drivers/net/wireless/realtek/rtw89/phy.c void rtw89_phy_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb, · line 3636
Quoted 10 lines
drivers/net/wireless/realtek/rtw89/phy.c +3
-2+break ; }if (!handler) { -rtw89_info (rtwdev,"PHY c2h class %d func %d not support\n" , class, - func); +rtw89_info_once (rtwdev,"PHY c2h class %d func %d not support\n" , + class, func);return ; }handler (rtwdev, skb, len);
Ping-Ke Shih
maintainerRe: [PATCH rtw-next 1/2] wifi: rtw89: print just once for unknown C2H events
In reply to Ping-Ke ShihQuoted 5 lines · Ping-Ke Shih
When driver receives new or unknown C2H events, it print out messages repeatedly once events are received, like
rtw89_8922ae0000:81:00.0: PHY c2h class 2 not support
Quoted 7 lines
To avoid the thousands of messages, use
rtw89_info_once()instead. Also, print out class/func for unknown (undefined) class.Reported-by Sean Anderson <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>Reviewed-by Sean Anderson <[email protected]>
2 patch(es) applied to rtw-next branch of rtw.git, thanks.
7e1c44fe4c2e wifi: rtw89: print just once for unknown C2H events 04a2de8cfc95 wifi: rtw89: add dummy C2H handlers for BCN resend and update done
Ping-Ke Shih
maintainerPATCH 2/2 wifi: rtw89: add dummy C2H handlers for BCN resend and update done
In reply to Ping-Ke ShihTwo C2H events are not listed, and driver throws
MAC c2h class 0 func 6 not support
MAC c2h class 1 func 3 not support
Since the implementation in vendor driver does nothing, add two dummy functions for them.
--- drivers/net/wireless/realtek/rtw89/mac.c | 13 ++++++++++++- drivers/net/wireless/realtek/rtw89/mac.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/mac.c +12 -1
@@ -5235,6 +5235,11 @@ rtw89_mac_c2h_bcn_cnt(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len) { } +static void +rtw89_mac_c2h_bcn_upd_done (struct rtw89_dev *rtwdev,struct sk_buff *c2h,u32 len) +{ +} +static void rtw89_mac_c2h_pkt_ofld_rsp (struct rtw89_dev *rtwdev,struct sk_buff *skb_c2h,u32 len)
@@ -5257,6 +5262,11 @@ rtw89_mac_c2h_pkt_ofld_rsp(struct rtw89_dev *rtwdev, struct sk_buff *skb_c2h,rtw89_complete_cond (wait, cond, &data); } +static void +rtw89_mac_c2h_bcn_resend (struct rtw89_dev *rtwdev,struct sk_buff *c2h,u32 len) +{ +} +static void rtw89_mac_c2h_tx_duty_rpt (struct rtw89_dev *rtwdev,struct sk_buff *skb_c2h,u32 len) {
@@ -5646,7 +5656,7 @@ void (* const rtw89_mac_c2h_ofld_handler[])(struct rtw89_dev *rtwdev, [RTW89_MAC_C2H_FUNC_EFUSE_DUMP] = NULL, [RTW89_MAC_C2H_FUNC_READ_RSP] = NULL, [RTW89_MAC_C2H_FUNC_PKT_OFLD_RSP] = rtw89_mac_c2h_pkt_ofld_rsp, - [RTW89_MAC_C2H_FUNC_BCN_RESEND] = NULL, + [RTW89_MAC_C2H_FUNC_BCN_RESEND] = rtw89_mac_c2h_bcn_resend, [RTW89_MAC_C2H_FUNC_MACID_PAUSE] = rtw89_mac_c2h_macid_pause, [RTW89_MAC_C2H_FUNC_SCANOFLD_RSP] = rtw89_mac_c2h_scanofld_rsp, [RTW89_MAC_C2H_FUNC_TX_DUTY_RPT] = rtw89_mac_c2h_tx_duty_rpt,
@@ -5661,6 +5671,7 @@ void (* const rtw89_mac_c2h_info_handler[])(struct rtw89_dev *rtwdev, [RTW89_MAC_C2H_FUNC_DONE_ACK] = rtw89_mac_c2h_done_ack, [RTW89_MAC_C2H_FUNC_C2H_LOG] = rtw89_mac_c2h_log, [RTW89_MAC_C2H_FUNC_BCN_CNT] = rtw89_mac_c2h_bcn_cnt, + [RTW89_MAC_C2H_FUNC_BCN_UPD_DONE] = rtw89_mac_c2h_bcn_upd_done, }; static
drivers/net/wireless/realtek/rtw89/mac.h +1 -0
@@ -419,6 +419,7 @@ enum rtw89_mac_c2h_info_func {RTW89_MAC_C2H_FUNC_DONE_ACK ,RTW89_MAC_C2H_FUNC_C2H_LOG ,RTW89_MAC_C2H_FUNC_BCN_CNT , +RTW89_MAC_C2H_FUNC_BCN_UPD_DONE =0x06 , RTW89_MAC_C2H_FUNC_INFO_MAX, };
Signature · 1 line
2.25.1
Re: [PATCH rtw-next 2/2] wifi: rtw89: add dummy C2H handlers for BCN resend and update done
Quoted 66 lines · Ping-Ke Shih
Two C2H events are not listed, and driver throws
MAC c2h class 0 func 6 not support
MAC c2h class 1 func 3 not supportSince the implementation in vendor driver does nothing, add two dummy functions for them.
Reported-by Bitterblue Smith <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>--- drivers/net/wireless/realtek/rtw89/mac.c | 13 ++++++++++++- drivers/net/wireless/realtek/rtw89/mac.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-)drivers/net/wireless/realtek/rtw89/mac.c +12
-1@@ -5235,6 +5235,11 @@ rtw89_mac_c2h_bcn_cnt(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len) { } +static void +rtw89_mac_c2h_bcn_upd_done (struct rtw89_dev *rtwdev,struct sk_buff *c2h,u32 len) +{ +} +static void rtw89_mac_c2h_pkt_ofld_rsp (struct rtw89_dev *rtwdev,struct sk_buff *skb_c2h,u32 len)@@ -5257,6 +5262,11 @@ rtw89_mac_c2h_pkt_ofld_rsp(struct rtw89_dev *rtwdev, struct sk_buff *skb_c2h,rtw89_complete_cond (wait, cond, &data); } +static void +rtw89_mac_c2h_bcn_resend (struct rtw89_dev *rtwdev,struct sk_buff *c2h,u32 len) +{ +} +static void rtw89_mac_c2h_tx_duty_rpt (struct rtw89_dev *rtwdev,struct sk_buff *skb_c2h,u32 len) {@@ -5646,7 +5656,7 @@ void (* const rtw89_mac_c2h_ofld_handler[])(struct rtw89_dev *rtwdev, [RTW89_MAC_C2H_FUNC_EFUSE_DUMP] = NULL, [RTW89_MAC_C2H_FUNC_READ_RSP] = NULL, [RTW89_MAC_C2H_FUNC_PKT_OFLD_RSP] = rtw89_mac_c2h_pkt_ofld_rsp, - [RTW89_MAC_C2H_FUNC_BCN_RESEND] = NULL, + [RTW89_MAC_C2H_FUNC_BCN_RESEND] = rtw89_mac_c2h_bcn_resend, [RTW89_MAC_C2H_FUNC_MACID_PAUSE] = rtw89_mac_c2h_macid_pause, [RTW89_MAC_C2H_FUNC_SCANOFLD_RSP] = rtw89_mac_c2h_scanofld_rsp, [RTW89_MAC_C2H_FUNC_TX_DUTY_RPT] = rtw89_mac_c2h_tx_duty_rpt,@@ -5661,6 +5671,7 @@ void (* const rtw89_mac_c2h_info_handler[])(struct rtw89_dev *rtwdev, [RTW89_MAC_C2H_FUNC_DONE_ACK] = rtw89_mac_c2h_done_ack, [RTW89_MAC_C2H_FUNC_C2H_LOG] = rtw89_mac_c2h_log, [RTW89_MAC_C2H_FUNC_BCN_CNT] = rtw89_mac_c2h_bcn_cnt, + [RTW89_MAC_C2H_FUNC_BCN_UPD_DONE] = rtw89_mac_c2h_bcn_upd_done, }; staticdrivers/net/wireless/realtek/rtw89/mac.h +0
-0
drivers/net/wireless/realtek/rtw89/mac.h enum rtw89_mac_c2h_info_func { · line 425
Quoted 7 lines
drivers/net/wireless/realtek/rtw89/mac.h +1
-0@@ -419,6 +419,7 @@ enum rtw89_mac_c2h_info_func {RTW89_MAC_C2H_FUNC_DONE_ACK ,RTW89_MAC_C2H_FUNC_C2H_LOG ,RTW89_MAC_C2H_FUNC_BCN_CNT , +RTW89_MAC_C2H_FUNC_BCN_UPD_DONE =0x06 , RTW89_MAC_C2H_FUNC_INFO_MAX, };
It's not how I would fix it, but fine with me.