[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191016153646.GG17013@lunn.ch>
Date: Wed, 16 Oct 2019 17:36:46 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Russell King - ARM Linux admin <linux@...linux.org.uk>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Woojung Huh <woojung.huh@...rochip.com>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
Florian Fainelli <f.fainelli@...il.com>,
Daniel Wagner <dwagner@...e.de>, netdev@...r.kernel.org,
bcm-kernel-feedback-list@...adcom.com,
Stefan Wahren <wahrenst@....net>,
linux-arm-kernel@...ts.infradead.org,
linux-rpi-kernel@...ts.infradead.org
Subject: Re: lan78xx and phy_state_machine
> > - lan78xx_phy_init() (incl. the call to phy_connect_direct()) is called
> > after register_netdev(). This may cause races.
>
> That isn't a problem. We have lots of network device drivers that do
> this - in their open() function.
Hi Russell
Actually, here is it. lan7801_phy_init() finds the PHY device and
connects it to the MAC. lan78xx_open() calls phy_start(), with the
assumption lan7801_phy_init() has been called.
But the stack trace just provided shows this assumption is wrong. As
soon a register_netdev() is called, the kernel auto configuration is
kicking in and opening the device.
lan78xx_phy_init() needs to happen before register_netdev(), or inside
lan78xx_open().
Andrew
Powered by blists - more mailing lists