All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ajrat Makhmutov <rauty@altlinux.org>
To: stable@vger.kernel.org
Cc: sashal@kernel.org, nbd@nbd.name, linux-wireless@vger.kernel.org,
	Leon Yen <leon.yen@mediatek.com>,
	Ming Yen Hsieh <mingyen.hsieh@mediatek.com>,
	David Ruth <druth@chromium.org>,
	Ajrat Makhmutov <rauty@altlinux.org>
Subject: [PATCH 6.12.y v3 1/3] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain
Date: Thu, 18 Jun 2026 11:14:11 +0300	[thread overview]
Message-ID: <20260618081413.17812-2-rauty@altlinux.org> (raw)
In-Reply-To: <20260618081413.17812-1-rauty@altlinux.org>

From: Leon Yen <leon.yen@mediatek.com>

commit 2425dc7beaadc39c2636f97f8bdc22dc3cf88149 upstream.

Some countries have strict RF restrictions where changing the regulatory
domain dynamically based on the connected AP is not acceptable.
This patch disables Beacon country IE hinting when a valid country code
is set from usersland (e.g., by system using iw or CRDA).

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Tested-by: David Ruth <druth@chromium.org>
Link: https://patch.msgid.link/20240412085357.13756-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Ajrat Makhmutov <rauty@altlinux.org>
---
v2: drop redundant "cherry picked from" trailer; add backporter
    Signed-off-by. No code change.
v3: add cover letter with upstream/stable references; mark target 6.12.y.

 drivers/net/wireless/mediatek/mt76/mt7921/init.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index 4bd533c4ba9a1..276dfb9c26e0d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -137,6 +137,13 @@ mt7921_regd_notifier(struct wiphy *wiphy,
 	dev->mt76.region = request->dfs_region;
 	dev->country_ie_env = request->country_ie_env;
 
+	if (request->initiator == NL80211_REGDOM_SET_BY_USER) {
+		if (dev->mt76.alpha2[0] == '0' && dev->mt76.alpha2[1] == '0')
+			wiphy->regulatory_flags &= ~REGULATORY_COUNTRY_IE_IGNORE;
+		else
+			wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
+	}
+
 	if (pm->suspended)
 		return;
 
-- 
2.50.1


  reply	other threads:[~2026-06-18  8:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10  8:09 [stable request] mt7921e: backport two mt76 fixes to 6.12.y Ajrat Makhmutov
2026-06-11  0:45 ` Sasha Levin
2026-06-11 10:38   ` Ajrat Makhmutov
2026-06-16 13:21   ` Ajrat Makhmutov
2026-06-19  4:06     ` Sasha Levin
2026-06-17 12:57 ` [PATCH 1/3] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Ajrat Makhmutov
2026-06-17 12:57   ` [PATCH 2/3] wifi: mt76: mt7921: fix a potential scan no APs Ajrat Makhmutov
2026-06-17 12:57   ` [PATCH 3/3] wifi: mt76: mt7921: fix potential deadlock in mt7921_roc_abort_sync Ajrat Makhmutov
2026-06-17 13:08 ` [PATCH v2 1/3] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Ajrat Makhmutov
2026-06-17 13:08   ` [PATCH v2 2/3] wifi: mt76: mt7921: fix a potential scan no APs Ajrat Makhmutov
2026-06-17 13:08   ` [PATCH v2 3/3] wifi: mt76: mt7921: fix potential deadlock in mt7921_roc_abort_sync Ajrat Makhmutov
2026-06-18  8:14   ` [PATCH 6.12.y v3 0/3] mt7921e: backport three mt76 fixes to 6.12.y Ajrat Makhmutov
2026-06-18  8:14     ` Ajrat Makhmutov [this message]
2026-06-18  8:14     ` [PATCH 6.12.y v3 2/3] wifi: mt76: mt7921: fix a potential scan no APs Ajrat Makhmutov
2026-06-18  8:14     ` [PATCH 6.12.y v3 3/3] wifi: mt76: mt7921: fix potential deadlock in mt7921_roc_abort_sync Ajrat Makhmutov

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=20260618081413.17812-2-rauty@altlinux.org \
    --to=rauty@altlinux.org \
    --cc=druth@chromium.org \
    --cc=leon.yen@mediatek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mingyen.hsieh@mediatek.com \
    --cc=nbd@nbd.name \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /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.