diff mbox series

powerpc/prom_init: Fixup missing powermac #size-cells on i2s nodes

Message ID 20250318192256.3534046-1-robh@kernel.org (mailing list archive)
State Superseded
Headers show
Series powerpc/prom_init: Fixup missing powermac #size-cells on i2s nodes | expand

Commit Message

Rob Herring March 18, 2025, 7:22 p.m. UTC
On some powermacs `i2s` nodes are missing `#size-cells` properties,
which is deprecated and now triggers a warning at boot since commit
045b14ca5c36 ("of: WARN on deprecated #address-cells/#size-cells
handling").

For example:

  Missing '#size-cells' in /pci@f2000000/mac-io@17/i2s@10000
  WARNING: CPU: 0 PID: 462 at drivers/of/base.c:134 of_bus_n_size_cells+0xb0/0x120
  Hardware name: PowerMac3,4 7400 0xc0209 PowerMac
  ...
  Call Trace:
    of_bus_n_size_cells+0xb0/0x120 (unreliable)
    of_bus_default_count_cells+0x40/0x60
    __of_get_address+0x158/0x294
    __of_address_to_resource+0x48/0x258
    i2sbus_probe+0x564/0x85c [snd_aoa_i2sbus]
    macio_device_probe+0x60/0x108
    really_probe+0xd8/0x344
    __driver_probe_device+0x90/0x1f0
    driver_probe_device+0x40/0xf4
    ...

As there's already a fixup for the same issue on `escc` nodes, add
`i2s` device_type to the existing fixup.

Reported-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 arch/powerpc/kernel/prom_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Madhavan Srinivasan March 19, 2025, 2:05 a.m. UTC | #1
On 3/19/25 12:52 AM, Rob Herring (Arm) wrote:
> On some powermacs `i2s` nodes are missing `#size-cells` properties,
> which is deprecated and now triggers a warning at boot since commit
> 045b14ca5c36 ("of: WARN on deprecated #address-cells/#size-cells
> handling").
> 
> For example:
> 
>   Missing '#size-cells' in /pci@f2000000/mac-io@17/i2s@10000
>   WARNING: CPU: 0 PID: 462 at drivers/of/base.c:134 of_bus_n_size_cells+0xb0/0x120
>   Hardware name: PowerMac3,4 7400 0xc0209 PowerMac
>   ...
>   Call Trace:
>     of_bus_n_size_cells+0xb0/0x120 (unreliable)
>     of_bus_default_count_cells+0x40/0x60
>     __of_get_address+0x158/0x294
>     __of_address_to_resource+0x48/0x258
>     i2sbus_probe+0x564/0x85c [snd_aoa_i2sbus]
>     macio_device_probe+0x60/0x108
>     really_probe+0xd8/0x344
>     __driver_probe_device+0x90/0x1f0
>     driver_probe_device+0x40/0xf4
>     ...
> 
> As there's already a fixup for the same issue on `escc` nodes, add
> `i2s` device_type to the existing fixup.
> 
> Reported-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

Have already picked up this patch as part of powerpc-next. 

https://patchwork.ozlabs.org/project/linuxppc-dev/patch/875xmizl6a.fsf@igel.home/

Maddy

> ---
>  arch/powerpc/kernel/prom_init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 57082fac4668..69018a2afc41 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -2889,11 +2889,11 @@ static void __init fixup_device_tree_pmac(void)
>  	char type[8];
>  	phandle node;
>  
> -	// Some pmacs are missing #size-cells on escc nodes
> +	// Some pmacs are missing #size-cells on escc and i2s nodes
>  	for (node = 0; prom_next_node(&node); ) {
>  		type[0] = '\0';
>  		prom_getprop(node, "device_type", type, sizeof(type));
> -		if (prom_strcmp(type, "escc"))
> +		if (prom_strcmp(type, "escc") && prom_strcmp(type, "i2s"))
>  			continue;
>  
>  		if (prom_getproplen(node, "#size-cells") != PROM_ERROR)
Christoph Biedl March 20, 2025, 8:26 p.m. UTC | #2
Rob Herring (Arm) wrote...

> On some powermacs `i2s` nodes are missing `#size-cells` properties,
> which is deprecated and now triggers a warning at boot since commit
> 045b14ca5c36 ("of: WARN on deprecated #address-cells/#size-cells
> handling").

Tested-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>

Can confirm this makes the warning disappear on the both devices
reported earlier in private:

* PowerMac3,4 7400 0xc0209 PowerMac
* PowerMac11,2 PPC970MP 0x440101 PowerMac
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 57082fac4668..69018a2afc41 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2889,11 +2889,11 @@  static void __init fixup_device_tree_pmac(void)
 	char type[8];
 	phandle node;
 
-	// Some pmacs are missing #size-cells on escc nodes
+	// Some pmacs are missing #size-cells on escc and i2s nodes
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = '\0';
 		prom_getprop(node, "device_type", type, sizeof(type));
-		if (prom_strcmp(type, "escc"))
+		if (prom_strcmp(type, "escc") && prom_strcmp(type, "i2s"))
 			continue;
 
 		if (prom_getproplen(node, "#size-cells") != PROM_ERROR)