From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 1C2BB470137 for ; Fri, 14 Aug 2026 12:51:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786711882; cv=none; b=M7sUxAqYyOmxOlNLoD3q9AziXn2ImdknW34+L3zuOx8jpf9INKQoJ99dYiGnEUJnOl+OvjkR9g93Yh87V+HD3LiYNBePPw7YsSXHTP/mTZh96yjzqhQb32wK0Wnv/qcYtQWYx5yLcHBuAWIoRnBUEoD5Gg06qTFFJgTm7Wh9elg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786711882; c=relaxed/simple; bh=6nWgVQ6K1iD5+9XLXAkupXMvKGBCS3eLIaZ7Es8WIT0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FMd39ZlXnM4ga5W/xx4dWA65Kvan9kLH/rRjNe3OKyM8VnueyjyWpLmetYxU1XJcePvex8SqhDPXAnjP3RjTNZhtJaXJOON1VQeL3SrUd2JYb8rkHjyrGgSH/QfmthxoraaPCDN/CFLwIe9W7vA3NV3F8VboSj/are7lVuQPeY8= 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=NcUyIm0G; arc=none smtp.client-ip=209.85.128.53 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="NcUyIm0G" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4996f1ee4a4so8359185e9.2 for ; Fri, 14 Aug 2026 05:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786711875; x=1787316675; 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=d7kfFCn+GNg9NumksCvYfbd5lgR/VvSMlydTU1rt7oM=; b=NcUyIm0GyPHgJzCrTbVC2k1UJgPukP3L1ARr2hrksAqbC9D5Yl8IPIqAh8A8OuTK0B t7QIMBOCD2n3qJXWpw6peT6Q/U0I6imD/By9kspLeMW8ekQPT9NsUTdi1MvXkF0wKDFl xBCY3xt8f+lsjsgWj2TLmmPn0Rbk2mUcUqHvjr6tw5fazcyyXiUy8EYfBaqY8LrxQgLy w0ZQz/LGniq+kh1dR5JA8pM+kEb180UxJGLQ/6r79i3p/v/LDJuQMKUFTvhz9pIqpnLF hMFJNGIcjJIWLelMbY2NsZbW7XbjDQt/vdp1kolXo28nqNc+Rche1xpe8wLTSJpjUtGp lI3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786711875; x=1787316675; 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=d7kfFCn+GNg9NumksCvYfbd5lgR/VvSMlydTU1rt7oM=; b=N/i2IBeM1NOmRGQ+gP9DmXBC++TNgypzh+16ndF7sbEhZ4hal1tOhYfvjJpPQoSpA2 1xPk05kEKJEwbL48GSvdLjMnL8myOS5LXJHT263HHeTugNYOxDH5iMWdtXrQAVRx5hxk iaMzEkk3orFS6iw51reFFoQY7v1dMyOJ+5qA1HZPLA3myqTPfq+x7Pd+CEvhB0mnGjBQ cE+u41uq5NVH3A/Ptdp6XrWMJIi30q9Mez2Ueu3Qnmxo+6/k0xhpVWyEyhVB/gkH9C/H a2LWI8umUBWjMScIdQJSx2RDz8ngomQ8RzruCvBwcnRKWm4f3kePFbDKRU2xpvnFbQ6l 3ZjA== X-Forwarded-Encrypted: i=1; AHgh+RrM1w6RCpZW1EHVTyHRd9dicl9vj/ziJ6T1e6SXH0MzpDecRYWzhKHxehmLFe5Z679H84mGKF61on8Em8E=@vger.kernel.org X-Gm-Message-State: AOJu0Yzl7S0nV6gElnLwB9C5R4WBH5TTKrshWa2bDWA9qyuuNeeCLwXf Rr0Ee5UUsxrk81lATnKbygnmdj3UhzjOeaK+ShYxXVyzDwWx3Pi7Wq6x X-Gm-Gg: AR+sD130fappg73gA8/rfE812qEw/I1pHjU0Pjunp8Hi7NrfrU7bOXCaNmdJiw9iNal M4Kz3RmAFmD4xXDn/iHfStTL/ibXHNpsqNic2tvSrD6dUwu2ZB/OhjtCT3/4BlqZ5Pz+DD03wMR 9DxrWykEymIKQCBhBxMBoefFTAEq4SaIhT7aqTtLCqEa9jwuYu181WPKEJ7iQI/rM5AmR+G2a9W NfKiLtDTkt0XytZDVK+cTMVnVU45IfgiEi7KORQVix9gdknQvVlXmpjsbymzeMpqNmp2YQsRI9z Rs78fGMs4IQL1yMowBnxUkynw/QYFr8bDlxDoG4Ve/ClgXhMY4nOXwQ2sAmdSi10PA0osoIWSTz BUaNBMHKQtHXggqWVWvMExxl/JVF2UHsCUktp944E8OXjgxZoM3BWc669tDqqPcbN0LfKQfxWRB ILUJh9ZtRYWxceituhpQ6XxCXhLyaGdwuIwMc+BZehqFEAri9e4FJz6NabLf9+FnIWrrb7Za7Xp lOkIRXHP6EfYJ727Ia9zSU36IsXauXhmhVvgNA0IK79ri9kTglNocprctdk4h3RwQ== X-Received: by 2002:a05:600c:6986:b0:499:79ba:ed92 with SMTP id 5b1f17b1804b1-49988c5efe7mr59441285e9.13.1786711875179; Fri, 14 Aug 2026 05:51:15 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 05:51:14 -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 1/3] dt-bindings: net: wireless: add flag marvell,ignore-regulatory-hint Date: Fri, 14 Aug 2026 15:50:23 +0300 Message-ID: <20260814125025.90522-1-gvalkov@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: 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. Add 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. [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 --- Thank you Brian and Johannes! > Just because you found it difficult doesn't mean we should accept the > wrong approach. I agree. Guidance and careful inspection helps reach a good solution. > IIUC, you're using a PCIe-based WiFi card, and that's enabled in > arch/arm/boot/dts/marvell/armada-385-linksys.dtsi: > > &pcie1 { > /* Marvell 88W8864, 5GHz-only */ > status = "okay"; > }; > > &pcie2 { > /* Marvell 88W8864, 2GHz-only */ > status = "okay"; > }; No, you are referring to the main radios, which are not part of these patch series. Would you allow me to also add the flag to them? Their driver is not part of Linux so only dt bindings need to be added. The changes here target the third radio: - phy2: Marvell 88W8887 802.11ac/b/g/n 2.4 / 5 GHz, region US - compatible = marvell,sd8897 works I cannot confirm if any other devices from the family need the fix or not, so I intentionally target the board dts, and not the include: armada-385-linksys.dtsi > Side question: did you consider Jeff's suggestion from v2, to try the > 'reg_alpha2' module param? It might already do what you need, and it > only requires you configure your OpenWrt builds properly, I think. A universal solution is better than targeting OpenWrt only. And unfortunately I have no idea how to implement this. > I'm not sure what you're saying here In v3 I wanted to reuse a flag for both drivers. Using a root flag was objected, so in v4 I added a flag for mwifiex, and I would like to add the same flag to mwlwifi later. - driver dev_name(adapter->dev) = mmc0:0001:1 dev_fwnode(adapter->dev) = wifi@1 marvell,ignore-regulatory-hint = 1 - procfs /proc/device-tree/soc/internal-regs/sdhci@d8000/wifi@1 compatible = marvell,sd8897 marvell,ignore-regulatory-hint name = wifi reg v4: 1. Add binding documentation for flag marvell,ignore-regulatory-hint 2. Add dt for sd8897 and move the flag there, I used sample from docs 3. Use device_property_read_bool in the driver v3: I implemented and tested a better approach with no board specific code: 1. check for a device-tree flag in mwifiex_register_cfg80211in() !of_property_read_bool(of_root, "marvell,ignore-regulatory-hint") 2. add this flag to the root device tree of each affected board Currently this affects only armada-385-linksys-rango.dts, because Linux has no dts for venom. OpenWrt will take care of that. This approach is more flexible and scalable, because the flag can also be used in other drivers, e.g. mwlwifi (not part of Linux). v2: Replace the compatible device names, which are currently only available on OpenWrt with board names which are available on both Linux and OpenWrt. .../devicetree/bindings/net/wireless/marvell,sd8787.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/net/wireless/marvell,sd8787.yaml b/Documentation/devicetree/bindings/net/wireless/marvell,sd8787.yaml index 930b700b73d0..5f235cb9f3e5 100644 --- a/Documentation/devicetree/bindings/net/wireless/marvell,sd8787.yaml +++ b/Documentation/devicetree/bindings/net/wireless/marvell,sd8787.yaml @@ -59,6 +59,12 @@ properties: description: Calibration data for sub-band 3 in the 5GHz band. maxItems: 502 + marvell,ignore-regulatory-hint: + $ref: /schemas/types.yaml#/definitions/flag + description: + Ignore an incorrect regulatory hint from ROM, + so userspace can set the correct regulatory domain. + marvell,wakeup-pin: $ref: /schemas/types.yaml#/definitions/uint32 description: -- 2.55.0