Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Georgi Valkov" <gvalkov@gmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x
Date: Fri, 07 Aug 2026 18:37:29 +0000	[thread overview]
Message-ID: <20260807183730.4FDC01F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260807182124.41572-1-gvalkov@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] A vendor/device-specific workaround property (`marvell,ignore-regulatory-hint`) is incorrectly read from the global root device tree node (`of_root`) rather than the device's own OF node. Device Tree must correctly model hardware topology by placing device-specific properties in the node representing that physical device. Placing a vendor-specific property in the root node applies it globally to the entire system. If a system contains multiple Marvell Wi-Fi adapters (e.g., one built-in and one plugged in via USB or PCIe) and only one requires the regulatory hint to be ignored, this global flag will incorrectly apply the quirk to all of them. The driver should read this property from its own device node (e.g., `adapter->dev->of_node` or `adapter->dt_node`).
--

--- Patch [1]: [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x ---
commit 3a34f3fd7103c1109fdfbb027f11821961b37978
Author: Georgi Valkov <gvalkov@gmail.com>

wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x

This commit introduces a device-tree flag to allow affected platforms to
ignore incorrect regulatory hints hardcoded in the mwifiex ROM. This enables
userspace to set the correct platform regulatory domain and prevents extreme
restrictions on 5 GHz and DFS channels.

[1] https://github.com/kaloz/mwlwifi/issues/173#issuecomment-307879699
[2] https://github.com/openwrt/openwrt/issues/9956

> diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> --- 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 &&
> +				    !of_property_read_bool(of_root,
> +							   "marvell,ignore-regulatory-hint") &&

[Severity: Medium]
Is it intentional to read the device-specific property from the global of_root
node rather than the adapter's own device node (e.g., adapter->dev->of_node
or adapter->dt_node)?

If a system contains multiple Marvell Wi-Fi adapters and only one requires
this workaround, reading from the root node will globally apply the quirk to
all adapters in the system.

Would it be better to adhere to device tree architectural principles by
placing and reading this property in the node representing the specific
physical device?

>  				    regulatory_hint(wiphy, country_code))
>  					mwifiex_dbg(priv->adapter, ERROR,
>  						    "regulatory_hint() failed\n");

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260807182124.41572-1-gvalkov@gmail.com?part=1

  parent reply	other threads:[~2026-08-07 18:37 UTC|newest]

Thread overview: 7+ 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   ` sashiko-bot [this message]
2026-08-07 18:39   ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Johannes Berg
2026-08-07 19:49     ` George Valkov
2026-08-10 18:30       ` Brian Norris

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=20260807183730.4FDC01F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gvalkov@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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