7bd3a7bc7b
In particular, phy_connect before register_netdev. This is because register_netdev runs the netdev notifiers, which can race with the rest of the initialization in ag71xx_probe. In my case this manifested in two ways: 1) If ag71xx is compiled as a module and inserted after netifd has started, netifd is notified by register_netdev before the call to ag71xx_phy_connect. netifd tries to bring the interface up, which calls ag71xx_open, which in turn enters ag71xx_phy_start. This keys off ag->phy_dev (which is still NULL) and thinks this is a fixed-link board, and enters ag71xx_link_adjust. This looks at ag->speed which is not yet initialized and hits the BUG() in the switch (ag->speed) in ag71xx_link_adjust. This is the wrong code path for ag71xx_phy_start - my board has PHYs that need to be brought up with phy_start. Doing ag71xx_phy_connect before register_netdev ensures that ag->phy_dev is non-NULL before ag71xx_phy_start is ever called. 2) When ag71xx is built into the kernel, and netconsole is enabled, there is a gap in the initial burst of replayed printks right after the netdev comes up. My assumption is that netconsole is also triggered by a netdev notifier, and part of this printk burst happens before the call into ag71xx_phy_connect, so part of the burst is lost while the PHY comes up. This patch fixes the gap - all the printks before eth0 comes up are bursted in full when netconsole initializes. ag71xx_phy_connect_xxx no longer runs with a registered netdev, so the logging has been adjusted accordingly to avoid "unregistered net_device" or "eth%d" messages in dmesg. Signed-off-by: Catalin Patulea <cat@vv.carleton.ca> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38689 |
||
---|---|---|
.. | ||
adm5120 | ||
adm8668 | ||
amazon | ||
ar7 | ||
ar71xx | ||
at91 | ||
atheros | ||
au1000 | ||
avr32 | ||
bcm53xx | ||
brcm47xx | ||
brcm63xx | ||
brcm2708 | ||
cns3xxx | ||
cns21xx | ||
cobalt | ||
ep93xx | ||
gemini | ||
generic | ||
imx6 | ||
iop32x | ||
ixp4xx | ||
kirkwood | ||
lantiq | ||
malta | ||
mcs814x | ||
mpc52xx | ||
mpc83xx | ||
mpc85xx | ||
mvebu | ||
mxs | ||
octeon | ||
omap4 | ||
omap24xx | ||
orion | ||
ppc40x | ||
ppc44x | ||
pxa | ||
ramips | ||
rb532 | ||
realview | ||
sibyte | ||
sparc | ||
sunxi | ||
uml | ||
x86 | ||
xburst | ||
Makefile |