linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] brcmfmac: Prefer DT board type over DMI board type
@ 2023-01-06 13:19 Ivan T. Ivanov
  2023-01-06 16:21 ` Arend Van Spriel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ivan T. Ivanov @ 2023-01-06 13:19 UTC (permalink / raw)
  To: aspriel, marcan
  Cc: franky.lin, hante.meuleman, rmk+kernel, stefan.wahren,
	pbrobinson, jforbes, kvalo, davem, devicetree, edumazet,
	krzysztof.kozlowski+dt, kuba, pabeni, robh+dt, linux-arm-kernel,
	linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, Ivan T. Ivanov, stable

The introduction of support for Apple board types inadvertently changed
the precedence order, causing hybrid SMBIOS+DT platforms to look up the
firmware using the DMI information instead of the device tree compatible
to generate the board type. Revert back to the old behavior,
as affected platforms use firmwares named after the DT compatible.

Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties")

[1] https://bugzilla.opensuse.org/show_bug.cgi?id=1206697#c13

Cc: stable@vger.kernel.org
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Reviewed-by: Hector Martin <marcan@marcan.st>
---
Changes since v1
Rewrite commit message according feedback.
https://lore.kernel.org/all/20230106072746.29516-1-iivanov@suse.de/

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
index a83699de01ec..fdd0c9abc1a1 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
@@ -79,7 +79,8 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
 	/* Apple ARM64 platforms have their own idea of board type, passed in
 	 * via the device tree. They also have an antenna SKU parameter
 	 */
-	if (!of_property_read_string(np, "brcm,board-type", &prop))
+	err = of_property_read_string(np, "brcm,board-type", &prop);
+	if (!err)
 		settings->board_type = prop;
 
 	if (!of_property_read_string(np, "apple,antenna-sku", &prop))
@@ -87,7 +88,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
 
 	/* Set board-type to the first string of the machine compatible prop */
 	root = of_find_node_by_path("/");
-	if (root && !settings->board_type) {
+	if (root && err) {
 		char *board_type;
 		const char *tmp;
 
-- 
2.35.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] brcmfmac: Prefer DT board type over DMI board type
  2023-01-06 13:19 [PATCH v2] brcmfmac: Prefer DT board type over DMI board type Ivan T. Ivanov
@ 2023-01-06 16:21 ` Arend Van Spriel
  2023-01-06 16:35   ` Hector Martin
  2023-01-06 17:00 ` Peter Robinson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Arend Van Spriel @ 2023-01-06 16:21 UTC (permalink / raw)
  To: Ivan T. Ivanov, marcan
  Cc: franky.lin, hante.meuleman, rmk+kernel, stefan.wahren,
	pbrobinson, jforbes, kvalo, davem, devicetree, edumazet,
	krzysztof.kozlowski+dt, kuba, pabeni, robh+dt, linux-arm-kernel,
	linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, stable

On 1/6/2023 2:19 PM, Ivan T. Ivanov wrote:
> The introduction of support for Apple board types inadvertently changed
> the precedence order, causing hybrid SMBIOS+DT platforms to look up the
> firmware using the DMI information instead of the device tree compatible
> to generate the board type. Revert back to the old behavior,
> as affected platforms use firmwares named after the DT compatible.
> 
> Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties")
> 
> [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1206697#c13
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>

Looks good to me. I do have a question about the devicetree node for 
brcmfmac. The driver does a compatible check against 
"brcm,bcm4329-fmac". I actually expect all devicetree specifications to 
use this. That said I noticed the check for it in brcmf_of_probe() 
should be moved so it is the first check done.

Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Reviewed-by: Hector Martin <marcan@marcan.st>
> ---
> Changes since v1
> Rewrite commit message according feedback.
> https://lore.kernel.org/all/20230106072746.29516-1-iivanov@suse.de/
> 
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> index a83699de01ec..fdd0c9abc1a1 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> @@ -79,7 +79,8 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
>   	/* Apple ARM64 platforms have their own idea of board type, passed in
>   	 * via the device tree. They also have an antenna SKU parameter
>   	 */
> -	if (!of_property_read_string(np, "brcm,board-type", &prop))
> +	err = of_property_read_string(np, "brcm,board-type", &prop);
> +	if (!err)
>   		settings->board_type = prop;
>   
>   	if (!of_property_read_string(np, "apple,antenna-sku", &prop))
> @@ -87,7 +88,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
>   
>   	/* Set board-type to the first string of the machine compatible prop */
>   	root = of_find_node_by_path("/");
> -	if (root && !settings->board_type) {
> +	if (root && err) {
>   		char *board_type;
>   		const char *tmp;
>   

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] brcmfmac: Prefer DT board type over DMI board type
  2023-01-06 16:21 ` Arend Van Spriel
@ 2023-01-06 16:35   ` Hector Martin
  0 siblings, 0 replies; 6+ messages in thread
From: Hector Martin @ 2023-01-06 16:35 UTC (permalink / raw)
  To: Arend Van Spriel, Ivan T. Ivanov
  Cc: franky.lin, hante.meuleman, rmk+kernel, stefan.wahren,
	pbrobinson, jforbes, kvalo, davem, devicetree, edumazet,
	krzysztof.kozlowski+dt, kuba, pabeni, robh+dt, linux-arm-kernel,
	linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, stable

On 07/01/2023 01.21, Arend Van Spriel wrote:
> On 1/6/2023 2:19 PM, Ivan T. Ivanov wrote:
>> The introduction of support for Apple board types inadvertently changed
>> the precedence order, causing hybrid SMBIOS+DT platforms to look up the
>> firmware using the DMI information instead of the device tree compatible
>> to generate the board type. Revert back to the old behavior,
>> as affected platforms use firmwares named after the DT compatible.
>>
>> Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties")
>>
>> [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1206697#c13
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> 
> Looks good to me. I do have a question about the devicetree node for 
> brcmfmac. The driver does a compatible check against 
> "brcm,bcm4329-fmac". I actually expect all devicetree specifications to 
> use this. That said I noticed the check for it in brcmf_of_probe() 
> should be moved so it is the first check done.

We're talking about the machine compatible in the root OF node, not the
compatible for the device itself. That's how firmware selection for
non-Apple platforms works (and has worked since before the Apple stuff
got introduced): first try the machine type which is either derived from
DMI info or the root compatible, and fall back to generic firmware.

The device compatible is indeed always brcm,bcm4329-fmac.

- Hector

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] brcmfmac: Prefer DT board type over DMI board type
  2023-01-06 13:19 [PATCH v2] brcmfmac: Prefer DT board type over DMI board type Ivan T. Ivanov
  2023-01-06 16:21 ` Arend Van Spriel
@ 2023-01-06 17:00 ` Peter Robinson
  2023-01-09  7:30 ` patchwork-bot+netdevbpf
  2023-01-16 11:18 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Robinson @ 2023-01-06 17:00 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: aspriel, marcan, franky.lin, hante.meuleman, rmk+kernel,
	stefan.wahren, jforbes, kvalo, davem, devicetree, edumazet,
	krzysztof.kozlowski+dt, kuba, pabeni, robh+dt, linux-arm-kernel,
	linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, stable

On Fri, Jan 6, 2023 at 1:19 PM Ivan T. Ivanov <iivanov@suse.de> wrote:
>
> The introduction of support for Apple board types inadvertently changed
> the precedence order, causing hybrid SMBIOS+DT platforms to look up the
> firmware using the DMI information instead of the device tree compatible
> to generate the board type. Revert back to the old behavior,
> as affected platforms use firmwares named after the DT compatible.
>
> Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties")
>
> [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1206697#c13
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> Reviewed-by: Hector Martin <marcan@marcan.st>
Tested-by: Peter Robinson <pbrobinson@gmail.com>

Tested on a RPi3B+, a RPi4B and a Rockchips device with 6.2rc2 and it
fixed the issue I had seen on Fedora.

Thanks

> ---
> Changes since v1
> Rewrite commit message according feedback.
> https://lore.kernel.org/all/20230106072746.29516-1-iivanov@suse.de/
>
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> index a83699de01ec..fdd0c9abc1a1 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> @@ -79,7 +79,8 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
>         /* Apple ARM64 platforms have their own idea of board type, passed in
>          * via the device tree. They also have an antenna SKU parameter
>          */
> -       if (!of_property_read_string(np, "brcm,board-type", &prop))
> +       err = of_property_read_string(np, "brcm,board-type", &prop);
> +       if (!err)
>                 settings->board_type = prop;
>
>         if (!of_property_read_string(np, "apple,antenna-sku", &prop))
> @@ -87,7 +88,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
>
>         /* Set board-type to the first string of the machine compatible prop */
>         root = of_find_node_by_path("/");
> -       if (root && !settings->board_type) {
> +       if (root && err) {
>                 char *board_type;
>                 const char *tmp;
>
> --
> 2.35.3
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] brcmfmac: Prefer DT board type over DMI board type
  2023-01-06 13:19 [PATCH v2] brcmfmac: Prefer DT board type over DMI board type Ivan T. Ivanov
  2023-01-06 16:21 ` Arend Van Spriel
  2023-01-06 17:00 ` Peter Robinson
@ 2023-01-09  7:30 ` patchwork-bot+netdevbpf
  2023-01-16 11:18 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-09  7:30 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: aspriel, marcan, franky.lin, hante.meuleman, rmk+kernel,
	stefan.wahren, pbrobinson, jforbes, kvalo, davem, devicetree,
	edumazet, krzysztof.kozlowski+dt, kuba, pabeni, robh+dt,
	linux-arm-kernel, linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, stable

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri,  6 Jan 2023 15:19:05 +0200 you wrote:
> The introduction of support for Apple board types inadvertently changed
> the precedence order, causing hybrid SMBIOS+DT platforms to look up the
> firmware using the DMI information instead of the device tree compatible
> to generate the board type. Revert back to the old behavior,
> as affected platforms use firmwares named after the DT compatible.
> 
> Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties")
> 
> [...]

Here is the summary with links:
  - [v2] brcmfmac: Prefer DT board type over DMI board type
    https://git.kernel.org/netdev/net/c/a5a36720c3f6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] brcmfmac: Prefer DT board type over DMI board type
  2023-01-06 13:19 [PATCH v2] brcmfmac: Prefer DT board type over DMI board type Ivan T. Ivanov
                   ` (2 preceding siblings ...)
  2023-01-09  7:30 ` patchwork-bot+netdevbpf
@ 2023-01-16 11:18 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2023-01-16 11:18 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: aspriel, marcan, franky.lin, hante.meuleman, rmk+kernel,
	stefan.wahren, pbrobinson, jforbes, davem, devicetree, edumazet,
	krzysztof.kozlowski+dt, kuba, pabeni, robh+dt, linux-arm-kernel,
	linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, Ivan T. Ivanov, stable

"Ivan T. Ivanov" <iivanov@suse.de> wrote:

> The introduction of support for Apple board types inadvertently changed
> the precedence order, causing hybrid SMBIOS+DT platforms to look up the
> firmware using the DMI information instead of the device tree compatible
> to generate the board type. Revert back to the old behavior,
> as affected platforms use firmwares named after the DT compatible.
> 
> Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties")
> 
> [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1206697#c13
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> Reviewed-by: Hector Martin <marcan@marcan.st>
> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Tested-by: Peter Robinson <pbrobinson@gmail.com>

Dave applied this directly to net tree:

https://git.kernel.org/linus/a5a36720c3f6

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230106131905.81854-1-iivanov@suse.de/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-16 11:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 13:19 [PATCH v2] brcmfmac: Prefer DT board type over DMI board type Ivan T. Ivanov
2023-01-06 16:21 ` Arend Van Spriel
2023-01-06 16:35   ` Hector Martin
2023-01-06 17:00 ` Peter Robinson
2023-01-09  7:30 ` patchwork-bot+netdevbpf
2023-01-16 11:18 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).