From: Sean Anderson <sean.anderson@linux.dev>
To: Ping-Ke Shih <pkshih@realtek.com>, linux-wireless@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Bitterblue Smith <rtl8821cerfe2@gmail.com>,
Sean Anderson <sean.anderson@linux.dev>
Subject: [PATCH v2] wifi: rtw89: Print just once for unknown C2H classes
Date: Tue, 29 Jul 2025 16:44:37 -0400 [thread overview]
Message-ID: <20250729204437.164320-1-sean.anderson@linux.dev> (raw)
In-Reply-To: <d2d62793-046c-4b55-93ed-1d1f43cff7f2@gmail.com>
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. Do the same for each unsupported func of
the supported classes. 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>
---
Changes in v2:
- Also suppress unsupported func messages
drivers/net/wireless/realtek/rtw89/phy.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index f4eee642e5ce..9484d80eea9b 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -3535,17 +3535,25 @@ 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_ra, U8_MAX);
+ static DECLARE_BITMAP(printed_rfk_log, U8_MAX);
+ static DECLARE_BITMAP(printed_rfk_report, U8_MAX);
+ static DECLARE_BITMAP(printed_class, U8_MAX);
+ unsigned long *printed;
switch (class) {
case RTW89_PHY_C2H_CLASS_RA:
+ printed = printed_ra;
if (func < RTW89_PHY_C2H_FUNC_RA_MAX)
handler = rtw89_phy_c2h_ra_handler[func];
break;
case RTW89_PHY_C2H_RFK_LOG:
+ printed = printed_rfk_log;
if (func < ARRAY_SIZE(rtw89_phy_c2h_rfk_log_handler))
handler = rtw89_phy_c2h_rfk_log_handler[func];
break;
case RTW89_PHY_C2H_RFK_REPORT:
+ printed = printed_rfk_report;
if (func < ARRAY_SIZE(rtw89_phy_c2h_rfk_report_handler))
handler = rtw89_phy_c2h_rfk_report_handler[func];
break;
@@ -3554,12 +3562,16 @@ void rtw89_phy_c2h_handle(struct rtw89_dev *rtwdev, struct sk_buff *skb,
return;
fallthrough;
default:
- rtw89_info(rtwdev, "PHY c2h class %d not support\n", class);
+ if (!test_and_set_bit(class, printed_class))
+ 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);
+ if (!test_and_set_bit(func, printed))
+ 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
next prev parent reply other threads:[~2025-07-29 20:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Sean Anderson [this message]
2025-07-30 0:36 ` [PATCH v2] wifi: rtw89: Print just once for unknown C2H classes 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250729204437.164320-1-sean.anderson@linux.dev \
--to=sean.anderson@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=rtl8821cerfe2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.