openwrtv3/target/linux
Gabor Juhos 7bd3a7bc7b ar71xx: ag71xx: fix a race involving netdev registration
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
2013-11-08 08:17:54 +00:00
..
adm5120 targets: fix remaining targets for initramfs builds 2013-06-28 22:56:34 +00:00
adm8668 targets: prepare for supporting normal and initramfs images 2013-06-27 19:58:31 +00:00
amazon target: don't build jffs2 nor images by default 2013-06-05 20:58:59 +00:00
ar7 kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
ar71xx ar71xx: ag71xx: fix a race involving netdev registration 2013-11-08 08:17:54 +00:00
at91 at91: fix missing drivers/iio/adc/at91-adc.ko in kmod-at91-adc 2013-10-01 22:37:17 +00:00
atheros kernel: update 3.10 to 3.10.17 2013-10-23 12:51:05 +00:00
au1000 au1000: make sysupgrade compatible with all file system types 2013-11-07 12:46:16 +00:00
avr32 kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
bcm53xx kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
brcm47xx brcm47xx: fix detection of Asus RT-N12B1 and Netgear WNR3500L 2013-11-05 17:09:19 +00:00
brcm63xx kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
brcm2708 kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
cns3xxx build: unify arm target cflags 2013-09-26 17:53:20 +00:00
cns21xx kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
cobalt cobalt: do not build userland with support for mips1 2013-10-13 22:10:57 +00:00
ep93xx ep93xx: fix kmod-input-keyboard-ep93xx dependencies 2013-10-01 22:39:28 +00:00
gemini build: unify arm target cflags 2013-09-26 17:53:20 +00:00
generic kernel/3.10: add EOF marker support to the UBI layer 2013-11-07 19:53:00 +00:00
imx6 kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
iop32x targets: prepare for supporting normal and initramfs images 2013-06-27 19:58:31 +00:00
ixp4xx kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
kirkwood kirkwood: add support for dockstar 2013-11-06 19:24:32 +00:00
lantiq lantiq: fix TDW8970 lan/wan mac 2013-11-07 12:46:24 +00:00
malta kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
mcs814x build: unify arm target cflags 2013-09-26 17:53:20 +00:00
mpc52xx build: unify powerpc target cflags 2013-09-26 17:53:28 +00:00
mpc83xx build: unify powerpc target cflags 2013-09-26 17:53:28 +00:00
mpc85xx kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
mvebu kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
mxs kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
octeon kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
omap4 build: fix typo 2013-09-26 22:43:06 +00:00
omap24xx build: unify arm target cflags 2013-09-26 17:53:20 +00:00
orion build: unify arm target cflags 2013-09-26 17:53:20 +00:00
ppc40x kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
ppc44x kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
pxa targets: prepare for supporting normal and initramfs images 2013-06-27 19:58:31 +00:00
ramips ralink: revert 38348 as it breaks network on the hame-mpr 2013-11-07 12:45:52 +00:00
rb532 kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
realview kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
sibyte build: unify mips target cflags 2013-09-26 17:53:14 +00:00
sparc mark as broken (toolchain issues), bump kernel version 2013-11-07 09:27:52 +00:00
sunxi sunxi: drop CONFIG_DEVTMPFS option 2013-11-06 08:19:31 +00:00
uml uml: work around mangled parameter handling for ubd 2013-09-24 13:36:42 +00:00
x86 kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
xburst kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
Makefile Add kernel_nconfig make target 2010-08-06 21:36:35 +00:00