[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52f88c8bf0897f1b97360fd4f94bdfe2e18f6cc0.camel@embedd.com>
Date: Tue, 05 Dec 2023 23:15:58 +0100
From: Daniel Danzberger <dd@...edd.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: woojung.huh@...rochip.com, UNGLinuxDriver@...rochip.com,
netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>, Florian Fainelli
<f.fainelli@...il.com>
Subject: Re: [PATCH] net: dsa: microchip: fix NULL pointer dereference on
platform init
On Tue, 2023-12-05 at 20:17 +0200, Vladimir Oltean wrote:
> On Tue, Dec 05, 2023 at 06:33:18PM +0100, Daniel Danzberger wrote:
> > On Tue, 2023-12-05 at 18:55 +0200, Vladimir Oltean wrote:
> > > On Tue, Dec 05, 2023 at 09:00:39AM +0100, Daniel Danzberger wrote:
> > > > > Is this all that's necessary for instantiating the ksz driver through
> > > > > ds->dev->platform_data? I suppose not, so can you post it all, please?
> > > > Yes, that NULL pointer was the only issue I encountered.
> > >
> > > I was just thinking, the KSZ9477 has internal PHYs on ports 0-4, and an
> > > internal MDIO bus registered in ksz_mdio_register(). The bus registration
> > > won't work without OF, since it returns early when not finding
> > > of_get_child_by_name(dev->dev->of_node, "mdio").
> > Interesting, I did not notice that.
> > After the NULL pointer issue was fixed the switch just worked.
> > >
> > > Don't you need the internal PHY ports to work?
> > For now the switch seems to run just fine, with port 0 being the CPU port and 1-4 being used as
> > regular switch ports.
> > I will do some more testing this week however...
>
> What does "regular switch ports" mean? L2 forwarding between them?
> Could you give us an "ip addr" output?
root@...-ngr421:~# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host proto kernel_lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1502 qdisc mq state UP group default qlen 1000
link/ether 00:13:95:55:cf:d7 brd ff:ff:ff:ff:ff:ff
inet6 fe80::213:95ff:fe55:cfd7/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
3: lan1@...0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP group
default qlen 1000
link/ether 00:13:95:55:cf:d7 brd ff:ff:ff:ff:ff:ff
4: lan2@...0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state
LOWERLAYERDOWN group default qlen 1000
link/ether 00:13:95:55:cf:d7 brd ff:ff:ff:ff:ff:ff
5: lan3@...0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state
LOWERLAYERDOWN group default qlen 1000
link/ether 00:13:95:55:cf:d7 brd ff:ff:ff:ff:ff:ff
6: lan4@...0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state
LOWERLAYERDOWN group default qlen 1000
link/ether 00:13:95:55:cf:d7 brd ff:ff:ff:ff:ff:ff
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:13:95:55:cf:d7 brd ff:ff:ff:ff:ff:ff
inet 192.168.20.1/24 brd 192.168.20.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 fd4e:2bf5:cc74::1/60 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::213:95ff:fe55:cfd7/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
The lan* devices are then bridged together:
root@...-ngr421:~# brctl show
bridge name bridge id STP enabled interfaces
br-lan 7fff.00139555cfd7 no lan4
lan2
lan3
lan1
--
Regards
Daniel Danzberger
embeDD GmbH, Alter Postplatz 2, CH-6370 Stans
Powered by blists - more mailing lists