Devicetree
 help / color / mirror / Atom feed
From: Georgi Valkov <gvalkov@gmail.com>
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 1/3] dt-bindings: net: wireless: add flag marvell,ignore-regulatory-hint
Date: Tue, 18 Aug 2026 00:54:26 +0300	[thread overview]
Message-ID: <20260817215428.84740-1-gvalkov@gmail.com> (raw)
In-Reply-To: <CADOrJmbTyrGGkq+9OJDXCgTa2HvNo8BWxoE6yjafcrOq7WNamw@mail.gmail.com>

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

Cc: stable@vger.kernel.org
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
---
v5:
1. description: remove tag Tested-on
2. add #address-cells = <1>, #size-cells = <0> to fix a warning:
arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts:183.3-13:
Warning (reg_format): /soc/internal-regs/sdhci@d8000/wifi@1:reg:
property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)

3. description: add info about testing

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


  reply	other threads:[~2026-08-17 21:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <anWWr80yAcOQaVVS@nxpwireless-Inspiron-14-Plus-7440>
2026-08-07 18:21 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Georgi Valkov
2026-08-07 18:21   ` [PATCH v3 2/2] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint Georgi Valkov
2026-08-07 18:43     ` sashiko-bot
2026-08-07 18:37   ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x sashiko-bot
2026-08-07 18:39   ` Johannes Berg
2026-08-07 19:49     ` George Valkov
2026-08-10 18:30       ` Brian Norris
2026-08-14 12:50         ` [PATCH 1/3] dt-bindings: net: wireless: add flag marvell,ignore-regulatory-hint Georgi Valkov
2026-08-14 12:50           ` [PATCH 2/3] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint Georgi Valkov
2026-08-14 13:00             ` sashiko-bot
2026-08-14 12:50           ` [PATCH 3/3] wifi: mwifiex: add dt flag to ignore incorrect ROM regulatory hint Georgi Valkov
2026-08-17  8:54           ` [PATCH 1/3] dt-bindings: net: wireless: add flag marvell,ignore-regulatory-hint Krzysztof Kozlowski
2026-08-17 10:43             ` George Valkov
2026-08-17 11:06               ` Krzysztof Kozlowski
2026-08-17 13:20                 ` George Valkov
2026-08-17 13:24                   ` Krzysztof Kozlowski
2026-08-17 13:48                     ` George Valkov
2026-08-17 21:54                       ` Georgi Valkov [this message]
2026-08-17 21:54                         ` [PATCH v5 2/3] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint Georgi Valkov
2026-08-17 22:05                           ` sashiko-bot
2026-08-17 21:54                         ` [PATCH v5 3/3] wifi: mwifiex: add dt flag to ignore incorrect ROM regulatory hint Georgi Valkov
2026-08-18  0:53                         ` [PATCH v5 1/3] dt-bindings: net: wireless: add flag marvell,ignore-regulatory-hint Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260817215428.84740-1-gvalkov@gmail.com \
    --to=gvalkov@gmail.com \
    --cc=Frank.Li@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=avraham.stern@intel.com \
    --cc=briannorris@chromium.org \
    --cc=chunfan.chen@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=error27@gmail.com \
    --cc=francesco@dolcini.it \
    --cc=gregory.clement@bootlin.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kees@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=rafael.beims@toradex.com \
    --cc=robh@kernel.org \
    --cc=s.kerkmann@pengutronix.de \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox