From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 56C2D3AE1BD for ; Mon, 17 Aug 2026 21:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787003733; cv=none; b=SdNjgYzABM2lpkTXhae4GwoMT5rSETmdYz1qQgzHxovH84AeTe4iXroPkKIKdTDmTNtooOohhwObrpfBqn+q+jFqulE2vbOa+KHPFoEy8GXe6Nism7m6ohFwwem3Vg0APgkfgnwY32ehUSV8u6KW3HCq5mmJ25Y4yx6u71ts/NU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787003733; c=relaxed/simple; bh=TJY3hex+l5/Tl/ivjiuYNGr3PPDEzX3hWulbnq7k2rs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eyyAkuza24a5JLa4rN4zf78cY4Fq/tpPrbz63EwF/ajyAoYW1Hhk1u/W1+NLI7LKwxCc0XDLpPQ1no3baIbbhDn5bSOSEKB3NB48lWOHVHHLKgvcOzNriWWDbc6RA3UzO1pcmwd+YkjqhA/b/zkX/rp0qmxAMXKdWF1XOT71D/M= 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=ieU7D1gJ; arc=none smtp.client-ip=209.85.128.42 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="ieU7D1gJ" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-493b966dd74so26233415e9.3 for ; Mon, 17 Aug 2026 14:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787003724; x=1787608524; 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=aDO6GjJPOwWJ3cCExfgafVeJUpNRoE4Oa0/Ds8leCk8=; b=ieU7D1gJHgWghdtS1WlsXGjaAOqxQ5SQ2/hN+drKbAQtYkxtV66KiOgghg8ALCAyDU TVghmz4mpuA0qRktYeRjHsaoMG3bxd83ixQI0AF9FaCrkltuTIvGXqfBaJka4ouFWZGE f1DDptgZHEvkFdTjKFDhQkRAZXrNnyxqW0DCiwJ/B/sS/DVJBYKHBbGOFGDnJLx9R5Yf iaf+OJAD2oD4U08PBBP+hBrv4SxwIId1sKnuwsjYM6zHNxT/CgvowSPXlX7q7Yim/mct ofKe2P75b2lHOI82F7SRifwhILmiTQiuNUok4y07HTdh3XHPf1FDGpeois31hBe7bkCE zd0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787003724; x=1787608524; 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=aDO6GjJPOwWJ3cCExfgafVeJUpNRoE4Oa0/Ds8leCk8=; b=TWo9HMTZIEfSo6xM7zW2RviJpHjMd2leP6Q8HFgOe0FWx3Zptw+8R+lYoy49YikdJq Q7n7gXnzhaxvBOEYAehtw+dVc5zrhP3Vd+KOgKGvSR+r8gOnCYLqVXYKGP5WdvNrhGwc OQYe3pqmdRh9t7dsoobeUVY9soodLFeqppgYa21FcEwKad9vhdSvYrjTRbSTlU04fWF1 l2AIImkQPoCQzHxfN8waXqncoN6wkFj77mBzT2lsvgs3J6+6YElhiLGFl/UMLi4lNFvf 2PX2MxXw/Pa8ePn+x1PjdZCCjqibjcgFN8jXB1zCWjNP5SnSnlML9BgH4/YfqihVPAss 9k+g== X-Forwarded-Encrypted: i=1; AHgh+RqLCiljEnGuhwpXxiO412Zmz7kY5AJlEMB5vTzqCnvp3fQE77LL7Ovs59BRhl2Z8boNdHuHblsb9N3ogZA=@vger.kernel.org X-Gm-Message-State: AOJu0YxRANrJa4xLlukg8fQZDpy2s/ybSpd/U26MgZP7UrO+IXi/17lI 4OdNPsH/KbtvYJxWJ7bk4QIc06igyFRnhpaqVkhDrFGOFagCNe0C59ty X-Gm-Gg: AR+sD13SHLFXi2++RYanKc7XtTbW4gtbAR7enKk9o28T7/ULZV/Sa3M3+5sAEZI9OiJ yye1A/C+YwiHaULElUhayQX5jSGWSOQw1sNc1pNRagrHYurNmPzKDdkQ8xk4Sg8TmvoNztSgBsk hZ3CP2I7jmAgM8b49Nyawg8srCRvdwNS7fDPd3RXlIYKBuqfwje8n3YPbmtOELbUdWy8e3fY4l7 FP2tJA3xy8uDZ0BRjMZNkU/F41VHCYNYSPhSyTZssmsRe+ukEg85j9wFfyKDjZv5KffszAQ3sf/ iDs09DGQxdJsdse3Slw2522QU26suDjPqswdXsQVmwfY8hrwURZVX5PeBw31b/uALMccch1Ye95 XrMY7LZ5q1aiL93UvJkotl6I5RxyY7LIa7mGKGhzShlj3XyFxdRkSYWXbPLAcTqqhxbUjNRAT/7 dS6XOzbqvRzy8e3VF3PCN6d1TeflV2l15k4StxJEpe9uRmSCZMRNPYI9w9pYqUsW94ePo11P/Rv ScjYw+fh5kYbuReZmoTNcSXy4ceq9VGZMJSq+IKQ87PyuLzz2zxOZt7ygcUiwYGCQcRgyTxMlHq dexiCqx9Lg== X-Received: by 2002:a05:600c:3485:b0:499:8758:8cb4 with SMTP id 5b1f17b1804b1-49987935eecmr451205815e9.5.1787003723726; Mon, 17 Aug 2026 14:55:23 -0700 (PDT) Received: from localhost.localdomain (85-118-76-205.mtel.net. [85.118.76.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49987b2a176sm309622525e9.4.2026.08.17.14.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2026 14:55:23 -0700 (PDT) From: Georgi Valkov To: briannorris@chromium.org, johannes@sipsolutions.net, andrew@lunn.ch, krzk+dt@kernel.org 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, 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 v5 3/3] wifi: mwifiex: add dt flag to ignore incorrect ROM regulatory hint Date: Tue, 18 Aug 2026 00:54:28 +0300 Message-ID: <20260817215428.84740-3-gvalkov@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817215428.84740-1-gvalkov@gmail.com> References: <20260817215428.84740-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 iw reg get: no longer reports region for phy2 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