From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BD7946D0A0 for ; Fri, 14 Aug 2026 12:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786711903; cv=none; b=VyU2plGmBSDj6e8d+XlCz2RhXCOG5KNfzOjOfP4qUuLzT9l4sU4oBWTJCsvIcBYEC6Qj6jEgqp+rCHOm6dSWLAhiF/ZQ/5oQtY1cbVYEEx1Sy+GKgAXhl83bJ9u8qa9qpgWbwo9zbUS2Bnf8qnfwZ/m6E57ABor3pIOWVRCxY1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786711903; c=relaxed/simple; bh=+cdB3jlbfOwPvLHC7qFXAtCDuK+tf5d2RCCwL4bvx5w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mCGWj407kuTnv2E3CmcieMuRNC57vAFSGtyOXCiFrQKg28goeM+183wfCFG/IAwjwVpZ6BRXKd/acvmO9UApCekW0R4Yl74wHffSgwVDyhWnq1WXOhlbo1sRZMjYd+7KpmboYJNaYJCOatIkeRCAfJeBejdnFKtJpqF/yhtP5Jc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cX2wSaV6; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cX2wSaV6" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-495437bb891so7136345e9.1 for ; Fri, 14 Aug 2026 05:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786711894; x=1787316694; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Jxmv/7o/NfVI89rAdTVtRInPWnXbZJb6x6oPXtKGqx4=; b=cX2wSaV6B2IcEy3kVNw/bSheHrVxlaAoZdKynyoUz3jg0oo+lhBYKap9dh7zHuaXPC JwXj7nVJwDTywIm61FURM33JKNdQe9Wep5Ml8eGwe0EVE26S2n8aBtedE4PNzAfh4azs P6p9PhmVkrnGSqg0We+Zfhgg7fmc2B5j40wQr4l48d72JGp772reLKme3z0sUoE/kH3O n4ohfiGZEthQhoPVbchm6SOQ9lhcqfXrt4P6UdYYBaFaEjFhnguADFqdsM799pRTmQHX wccvbMxR3rn3tl6BKRtVT9p+XyWR0Mi0aAVY1/poC976ahaM63yIzah/dmNwMBrwKf5c yaMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786711894; x=1787316694; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Jxmv/7o/NfVI89rAdTVtRInPWnXbZJb6x6oPXtKGqx4=; b=iBBaymUnirbrPsT6T0g0qJQ6rSx+2KqgdtYkNPCLYyQUjwfZkEXWI6peFcs8C5DEqF osZk7polDZVRIKsS2vaES/8sMyshiaXMCRM4MtGuw+22v1g2fwthpdo6M+15VYMMnEkS 6y/HAeyMUyHTKFT5Q9y2EGaEYKdo5ze2ElPg42I9PRBF4OmAwDELebth4n5QGHvFS24s 1cTmpT61X+oogk72V0qdoTeZug3rydkJH9IGsIVWoD6sNKL8z3Z4hHb5wCz64yNo/OrY JovyMcsrXugJa9ZImFBpiFE4HRMHaVot0bRNbpEpbzbjBOa5FxCzdcEpTVe0w+Be4xWt NjNw== X-Forwarded-Encrypted: i=1; AHgh+Rpju3SeQ+4GbgxbTJWVEYDSQqYNjhE61pbY308mlIZ4MAVYOQYMwhHfWI1dfCPV1VzqMsSUCf7aA1VyO8A=@vger.kernel.org X-Gm-Message-State: AOJu0YxxWKALB6JMpvmSo/h8DtV9STPTShagseZFBSUooQVUWwQqZDzk eQ8x3be7j2uZQ74kNJS8SbrmneUcuQnpYMQxjjN0NgtJswLHBmFtby8y X-Gm-Gg: AR+sD13ycgSPbTQLTp9SaEKibM9HSWV244mmXy+PDlnvANytCV5ydsLMRfajRORGnHj Am30xhbHQO4qQ0o866qRD/eJJcJhErYi8CK2hfq/J2SIgCGb7SL0p+eDRbA55Bo8gKfvWN2f/Sw 7Q6a7gWVG5VkwSbDb8bsLFGcvnCCQ4/FDczg7uOs0Wq5D2lJm8dYm7Wyfr4hL1qBYHMd7F5v9v8 76q3/OXkKZCWRbv5l1YoI04ZyyZUDJzYe2nRjl0UYRNe2QDySMXaC5pYtbdKcK+PLWRX+yspgDO mKNES0xJqFYSAZ17MqzP5f3/ZkD95EDjG7LjRHkImS2chQ9Rce5Qboy1QtUhgu692MlyLyu0dXM bkLDof1ueZVaD0FEv2iH9vHm8WtFPdh2ZAPxfPyU80EjSC6UbVIoZs7uyjMI8IJBJqhg2ewOymA 7LB5OeKM/G8+DET8Ga9Q8BeDHtLN1uFaoQz2gMiKDXsJCM3LS0HU4oeQv9UdvThm86juO2WOVzu 8mTNpdnqBuNx4MWsZBiYp95OoNFGZrqvRihmpXLE6NBsYTsW846naCmnxxtqDn6xw== X-Received: by 2002:a05:600d:117:b0:499:5f80:83ac with SMTP id 5b1f17b1804b1-49987ab4e1bmr49051825e9.7.1786711894092; Fri, 14 Aug 2026 05:51:34 -0700 (PDT) Received: from localhost.localdomain ([151.251.241.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49988ae8b62sm49727315e9.5.2026.08.14.05.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 05:51:33 -0700 (PDT) From: Georgi Valkov To: briannorris@chromium.org, johannes@sipsolutions.net, andrew@lunn.ch Cc: francesco@dolcini.it, johannes.berg@intel.com, kees@kernel.org, miriam.rachel.korenblit@intel.com, wenst@chromium.org, rafael.beims@toradex.com, avraham.stern@intel.com, error27@gmail.com, s.kerkmann@pengutronix.de, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, Frank.Li@nxp.com, chunfan.chen@gmail.com, linux-arm-kernel@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, stable@vger.kernel.org, gvalkov@gmail.com Subject: [PATCH 3/3] wifi: mwifiex: add dt flag to ignore incorrect ROM regulatory hint Date: Fri, 14 Aug 2026 15:50:25 +0300 Message-ID: <20260814125025.90522-3-gvalkov@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260814125025.90522-1-gvalkov@gmail.com> References: <20260814125025.90522-1-gvalkov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit WRT3200ACM and WRT32x routers always report a fixed US regulatory domain from the mwifiex ROM, which conflicts with the platform regulatory configuration on units sold outside the US market. For example: - phy0 mwlwifi 5 GHz, hard-coded region 98 EU mapped to FR - phy1 mwlwifi 2.4 GHz, hard-coded region 98 EU mapped to FR - phy2 mwifiex 2.4 and 5 GHz, hard-coded region US When the system boots, it detects a conflict between the user selected region and the radios, e.g. BG FR US, and applies extreme restrictions, preventing use of 5 GHz and DFS channels. This also affects phy0. Implement a device-tree flag, which allows affected platforms to ignore an incorrect regulatory hint from ROM, so userspace can set the correct platform regulatory domain. This avoids the region conflict and allows the 5 GHz radios to be used. The change affects only platforms which explicitly define this flag, and helps overcome the incorrect behaviour of proprietary radio firmware. [1] https://github.com/kaloz/mwlwifi/issues/173#issuecomment-307879699 [2] https://github.com/openwrt/openwrt/issues/9956 Tested-on: WRT3200ACM, OpenWrt Cc: stable@vger.kernel.org Signed-off-by: Georgi Valkov --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index abc703441c5d..26978158a0ad 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -4899,7 +4899,14 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) country_code = mwifiex_11d_code_2_region( adapter->region_code); + + /* Allow platforms to ignore an incorrect + * regulatory hint from ROM, so userspace + * can set the correct regulatory domain. + */ if (country_code && + !device_property_read_bool(adapter->dev, + "marvell,ignore-regulatory-hint") && regulatory_hint(wiphy, country_code)) mwifiex_dbg(priv->adapter, ERROR, "regulatory_hint() failed\n"); -- 2.55.0