mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julius Bairaktaris <julius@bairaktaris.de>
To: Jeff Johnson <jjohnson@kernel.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Baochen Qiang <baochen.qiang@oss.qualcomm.com>,
	Semih Baskan <strst.gs@gmail.com>
Subject: [PATCH ath-next 2/3] wifi: ath11k: ignore regulatory info of phys outside the hw mode
Date: Tue, 27 Oct 2026 08:55:43 +0100	[thread overview]
Message-ID: <20261027075544.19144-3-julius@bairaktaris.de> (raw)
In-Reply-To: <20261027075544.19144-1-julius@bairaktaris.de>

From: Semih Baskan <strst.gs@gmail.com>

The firmware sends a regulatory event for every phy it reports, also
for phys the selected hw mode does not use. On the Zyxel NBG7815
(IPQ8074) the firmware advertises DBS with phy_id_map 0x3 and DBS_SBS
with phy_id_map 0x7, and its events always carry num_phy 3. With DBS
selected num_radios is 2, so the event for phy 2 takes the fallback
path in ath11k_reg_handle_chan_list() and hits its WARN_ON(1) each time
the firmware starts:

  WARNING: CPU: 0 PID: 0 at drivers/net/wireless/ath/ath11k/reg.c:828 ath11k_reg_handle_chan_list+0x230/0x2e0 [ath11k]
  ath11k c000000.wifi: failed to process regulatory info -22

There is no radio to apply the rules of an unused phy to, so drop the
event, as the single_pdev_only case already does. A phy ID at or above
the num_phy of the event still goes to the fallback.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1

Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
---
 drivers/net/wireless/ath/ath11k/reg.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c
index 1030e119fd903..37be563d8de68 100644
--- a/drivers/net/wireless/ath/ath11k/reg.c
+++ b/drivers/net/wireless/ath/ath11k/reg.c
@@ -910,15 +910,27 @@ int ath11k_reg_handle_chan_list(struct ath11k_base *ab,
 	if (pdev_idx >= ab->num_radios) {
 		/* Process the event for phy0 only if single_pdev_only
 		 * is true. If pdev_idx is valid but not 0, discard the
-		 * event. Otherwise, it goes to fallback. In either case
+		 * event. The firmware also sends the rules of phys that
+		 * the selected hw mode does not use, discard those too.
+		 * Otherwise, it goes to fallback. In either case
 		 * ath11k_reg_reset_info() needs to be called to avoid
 		 * memory leak issue.
 		 */
+		u8 num_phy = reg_info->num_phy;
+
 		ath11k_reg_reset_info(reg_info);
 
 		if (ab->hw_params.single_pdev_only &&
 		    pdev_idx < ab->hw_params.num_rxdma_per_pdev)
 			return 0;
+
+		if (pdev_idx < num_phy) {
+			ath11k_dbg(ab, ATH11K_DBG_REG,
+				   "ignoring regulatory info of unused phy %d\n",
+				   pdev_idx);
+			return 0;
+		}
+
 		goto fallback;
 	}
 
-- 
2.53.0


  parent reply	other threads:[~2026-10-27  7:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27  7:55 [PATCH ath-next 0/3] wifi: ath11k: select the hardware mode Julius Bairaktaris
2026-10-27  7:55 ` [PATCH ath-next 1/3] wifi: ath11k: skip unknown hardware modes Julius Bairaktaris
2026-10-27  7:55 ` Julius Bairaktaris [this message]
2026-10-27  7:55 ` [PATCH ath-next 3/3] wifi: ath11k: add a module parameter to select the hardware mode Julius Bairaktaris
2026-10-28 19:03   ` Jeff Johnson
2026-10-31 19:54     ` Julius Bairaktaris

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=20261027075544.19144-3-julius@bairaktaris.de \
    --to=julius@bairaktaris.de \
    --cc=ath11k@lists.infradead.org \
    --cc=baochen.qiang@oss.qualcomm.com \
    --cc=jjohnson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=strst.gs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®