linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw89: Print only once for unsupported c2h classes
@ 2025-07-29 18:27 Sean Anderson
  2025-07-29 19:44 ` Bitterblue Smith
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Anderson @ 2025-07-29 18:27 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless; +Cc: linux-kernel, Sean Anderson

There are more unsupported functions than just LOWRT_RTY. Improve on
commit 3b66519b023b ("wifi: rtw89: phy: add dummy c2h handler to avoid
warning message") by printing a message just once when we first
encounter an unsupported class. This prevents messages like

rtw89_8922ae 0000:81:00.0: PHY c2h class 2 not support

from filling up dmesg.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
---

 drivers/net/wireless/realtek/rtw89/phy.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index f4eee642e5ce..5280ffd77b39 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -3535,6 +3535,7 @@ void rtw89_phy_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb,
 {
 	void (*handler)(struct rtw89_dev *rtwdev,
 			struct sk_buff *c2h, u32 len) = NULL;
+	static DECLARE_BITMAP(printed_support, U8_MAX);
 
 	switch (class) {
 	case RTW89_PHY_C2H_CLASS_RA:
@@ -3549,17 +3550,15 @@ void rtw89_phy_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb,
 		if (func < ARRAY_SIZE(rtw89_phy_c2h_rfk_report_handler))
 			handler = rtw89_phy_c2h_rfk_report_handler[func];
 		break;
-	case RTW89_PHY_C2H_CLASS_DM:
-		if (func == RTW89_PHY_C2H_DM_FUNC_LOWRT_RTY)
-			return;
-		fallthrough;
 	default:
-		rtw89_info(rtwdev, "PHY c2h class %d not support\n", class);
+		if (!test_and_set_bit(class, printed_support))
+			rtw89_info(rtwdev, "PHY c2h class %d not supported\n",
+				   class);
 		return;
 	}
 	if (!handler) {
-		rtw89_info(rtwdev, "PHY c2h class %d func %d not support\n", class,
-			   func);
+		rtw89_info(rtwdev, "PHY c2h class %d func %d not supported\n",
+			   class, func);
 		return;
 	}
 	handler(rtwdev, skb, len);
-- 
2.35.1.1320.gc452695387.dirty


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-08-04  1:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-29 18:27 [PATCH] wifi: rtw89: Print only once for unsupported c2h classes Sean Anderson
2025-07-29 19:44 ` Bitterblue Smith
2025-07-29 20:44   ` [PATCH v2] wifi: rtw89: Print just once for unknown C2H classes Sean Anderson
2025-07-30  0:36     ` Ping-Ke Shih
2025-07-31 20:19       ` Sean Anderson
2025-08-01  0:30         ` Ping-Ke Shih
2025-08-01 14:39           ` Sean Anderson
2025-08-04  1:31             ` Ping-Ke Shih
2025-07-30  3:42     ` Ping-Ke Shih
2025-07-31 20:16       ` Sean Anderson
2025-08-01  0:36         ` Ping-Ke Shih
2025-08-01 14:39           ` Sean Anderson
2025-07-30  0:44   ` [PATCH] wifi: rtw89: Print only once for unsupported c2h classes Ping-Ke Shih
2025-08-04  1:33   ` Ping-Ke Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).