Received: from air.basealt.ru (air.basealt.ru [193.43.8.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CC0A262D0B for ; Wed, 17 Jun 2026 13:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.43.8.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781701726; cv=none; b=Tx1J0PmK/bzXwv2o8gNtX2i7WBTHePVdiS0V7D6lVkWCkUjgZ8AIjjprzYPL5/+QwvcooFo/PMedgGpvKFiTL20bH29x8UB+bjYirEUz5UyJv2mDXAiW7qqHQKH6FyEcPRLyQyhZ1oz/ROuvvoiMcLcdtk1+KsyUEr2QoZUyno4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781701726; c=relaxed/simple; bh=7DgSmztFDpryrKv3ZkagBJxi3RaATmA0Vgu6TJwFON4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DUoxUaVy0O7/NoCKgoSBsGVPZ5SXHOF+q7vlNeE2DL+hDwWPVjWCaJLBKKhrwup2/1LJWYkkrK7kZ0R4AJu4buRJzpMFzwSJzCkiG1qB2sd+EMR7KqKkbF5O92Abfv/apnsCkZqpEF4GKOULMzYPyFHDIXhkuR/xfsQdjHWAmpM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=193.43.8.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: from ajratkogda.malta.altlinux.ru (obninsk.basealt.ru [217.15.195.17]) (Authenticated sender: ajratma) by air.basealt.ru (Postfix) with ESMTPSA id 8ACA2233A9; Wed, 17 Jun 2026 16:08:42 +0300 (MSK) From: Ajrat Makhmutov To: stable@vger.kernel.org Cc: sashal@kernel.org, Leon Yen , Ming Yen Hsieh , David Ruth , Felix Fietkau , Ajrat Makhmutov Subject: [PATCH v2 1/3] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Date: Wed, 17 Jun 2026 16:08:23 +0300 Message-ID: <20260617130826.1667503-1-rauty@altlinux.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260610080943.17734-1-rauty@altlinux.org> References: <20260610080943.17734-1-rauty@altlinux.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Leon Yen 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 Signed-off-by: Ming Yen Hsieh Tested-by: David Ruth Link: https://patch.msgid.link/20240412085357.13756-1-mingyen.hsieh@mediatek.com Signed-off-by: Felix Fietkau Signed-off-by: Ajrat Makhmutov --- v2: drop redundant "cherry picked from" trailer; add backporter Signed-off-by. No code change. 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