net: dsa: b53: mmap: fix device tree support
PATCH 1/1 net: dsa: b53: mmap: fix device tree support
B53_CPU_PORT should also be enabled in order to get a working switch.
--- drivers/net/dsa/b53/b53_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/b53/b53_mmap.c +1 -1
@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev,if (of_property_read_u32 (of_port,"reg" , ®))continue ; -if (reg <B53_CPU_PORT ) +if (reg <=B53_CPU_PORT ) pdata->enabled_ports |=BIT (reg); }
Signature · 1 line
2.30.2
Jakub Kicinski
maintainerdrivers/net/dsa/b53/b53_mmap.c static int b53_mmap_probe_of(struct platform_device *pdev, · line 267
Quoted 11 lines · On Fri, 10 Mar 2023 13:10:59 +0100 Álvaro Fernández Rojas wrote:
drivers/net/dsa/b53/b53_mmap.c +1
-1@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev,if (of_property_read_u32 (of_port,"reg" , ®))continue ; -if (reg <B53_CPU_PORT ) +if (reg <=B53_CPU_PORT ) pdata->enabled_ports |=BIT (reg);
Should we switch to B53_N_PORTS instead?
That's the bound used by the local "for each port" macro:
#define b53_for_each_port(dev, i) \
for (i = 0; i < B53_N_PORTS; i++) \
if (dev->enabled_ports & BIT(i)) Quoted 16 lines · Jakub Kicinski
drivers/net/dsa/b53/b53_mmap.c static int b53_mmap_probe_of(struct platform_device *pdev, · line 267
Quoted 11 lines · On Fri, 10 Mar 2023 13:10:59 +0100 Álvaro Fernández Rojas wrote:
drivers/net/dsa/b53/b53_mmap.c +1
-1@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev,if (of_property_read_u32 (of_port,"reg" , ®))continue ; -if (reg <B53_CPU_PORT ) +if (reg <=B53_CPU_PORT ) pdata->enabled_ports |=BIT (reg);Should we switch to
B53_N_PORTSinstead?
That's the bound used by the local "for each port" macro:
Quoted 3 lines
#define b53_for_each_port(dev, i) \
for (i = 0; i < B53_N_PORTS; i++) \
if (dev->enabled_ports & BIT(i))Yes, checking against B53_N_PORTS would be a better check.
Signature · 1 line
Florian
PATCH v2 1/1 net: dsa: b53: mmap: fix device tree support
In reply to Álvaro Fernández RojasCPU port should also be enabled in order to get a working switch.
---
v2: switch to B53_N_PORTS
drivers/net/dsa/b53/b53_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/b53/b53_mmap.c +1 -1
@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev,if (of_property_read_u32 (of_port,"reg" , ®))continue ; -if (reg <B53_CPU_PORT ) +if (reg <B53_N_PORTS ) pdata->enabled_ports |=BIT (reg); }
Signature · 1 line
2.30.2
Quoted 4 lines · Álvaro Fernández Rojas
CPU port should also be enabled in order to get a working switch.
Fixes a5538a777b73 ("net: dsa: b53: mmap: Add device tree support")Signed-off-by Álvaro Fernández Rojas <[email protected]>
Signature · 1 line
Florian
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 16 Mar 2023 18:28:07 +0100 you wrote:
CPU port should also be enabled in order to get a working switch.
Fixes a5538a777b73 ("net: dsa: b53: mmap: Add device tree support")Signed-off-by Álvaro Fernández Rojas <[email protected]>---
v2: switch toB53_N_PORTS[...]
Here is the summary with links:
- [v2] net: dsa: b53: mmap: fix device tree support
https://git.kernel.org/netdev/net/c/30796d0dcb6e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html