Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The device-specific property `marvell,ignore-regulatory-hint` is incorrectly placed in the global root node (`/`), lacking binding documentation and causing the quirk to erroneously apply to all `mwifiex` devices.
- [Medium] The `mwifiex` driver directly accesses the global `of_root` variable, which is undefined when `CONFIG_OF` is disabled, violating the driver model and risking linker errors.
--
--- Patch [2]: [PATCH v3 2/2] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint ---
commit 7033e1a77e69407f0088e5cd43fbc6b4fc03d549
Author: Georgi Valkov <[email protected]>
ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint
This patch adds the marvell,ignore-regulatory-hint flag to the WRT3200ACM
device tree. It prevents the system from applying extreme restrictions due
to conflicts between the user-selected region and the radios' hard-coded
US region.
> diff --git a/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts b/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts
> index 4ab45f294de22..6e283e223ca4c 100644
> --- a/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts
> +++ b/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts
> @@ -14,6 +14,7 @@ / {
> model = "Linksys WRT3200ACM";
> compatible = "linksys,rango", "linksys,armada385", "marvell,armada385",
> "marvell,armada380";
> + marvell,ignore-regulatory-hint;
[Severity: High]
Does adding this device-specific property to the global root node (/) instead
of a dedicated device node cause a regression where it applies universally?
Because the driver in drivers/net/wireless/marvell/mwifiex/cfg80211.c queries
this property from the root node:
mwifiex_register_cfg80211():
if (country_code &&
!of_property_read_bool(of_root,
"marvell,ignore-regulatory-hint") &&
regulatory_hint(wiphy, country_code))
this board quirk will be broadcast globally across the system.
If a user connects a generic USB mwifiex Wi-Fi adapter to this router, it
appears the driver would incorrectly apply the board quirk to the external
adapter, potentially causing a regression in regulatory compliance by ignoring
its valid regulatory hint.
Would it be safer to use of_machine_is_compatible() for this platform quirk?
[Severity: Medium]
Will querying of_root directly in the mwifiex driver cause a compilation
regression when CONFIG_OF is disabled?
Since of_root is only defined in drivers/of/base.c, and the mwifiex driver
does not depend on CONFIG_OF, this relies entirely on the compiler's dead-code
elimination to drop the of_root symbol reference when of_property_read_bool()
expands to an inline dummy.
Relying on dead code elimination for undefined symbols can be brittle.
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.