From mboxrd@z Thu Jan 1 00:00:00 1970 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 EDF643ACEF8; Thu, 18 Jun 2026 08:14:42 +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=1781770484; cv=none; b=nO+Pbd7PkoVYqM0BsiQzj3mRdxocO3LE9LSdOIh3Pl9WHPgIDTDiq+QjdFWYpeCw/ReV+wiAOUpebyNX4AU6qQP1qDe+oBjH8KezFjTv9fzF0eU3dBO+Nc6A9KWHezo12jDUgQiOZyIzln2GmkFaJOMtHSz9Bg+mneU/8j2vWbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781770484; c=relaxed/simple; bh=ZwhK/h4Q+VjqHenPjc7/UjM+BFXsGU2cwA04kE9ylDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C9YeFsI9uoquosfkpr7aH0i3ozkkHvJdCPHZZRKTXa+RGT/0XT3lx13harN+zJOAXcXqB1J6XphDUWZgj1gCxzwyhqeshMbL6G4JlQKmUdWPVzN9vmYXOlmgWqPOEeJ5TLnUQreaeN07QppEwYe0K7sOkOQFEZLCYiR/hkuQFv4= 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 A48CD233AC; Thu, 18 Jun 2026 11:14:34 +0300 (MSK) From: Ajrat Makhmutov To: stable@vger.kernel.org Cc: sashal@kernel.org, nbd@nbd.name, linux-wireless@vger.kernel.org, Leon Yen , Ming Yen Hsieh , David Ruth , Ajrat Makhmutov 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 Message-ID: <20260618081413.17812-2-rauty@altlinux.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260618081413.17812-1-rauty@altlinux.org> References: <20260617130826.1667503-1-rauty@altlinux.org> <20260618081413.17812-1-rauty@altlinux.org> Precedence: bulk X-Mailing-List: linux-wireless@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. 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