Openwrt/target/linux/ar71xx
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
..
base-files ar71xx: add user-space support for the WD My Net Wi-Fi Range Extender 2013-11-07 22:31:53 +00:00
files ar71xx: ag71xx: fix a race involving netdev registration 2013-11-08 08:17:54 +00:00
generic ar71xx: build image for the WD My Net Wi-Fi Range Extender 2013-11-07 22:31:54 +00:00
image ar71xx: build image for the WD My Net Wi-Fi Range Extender 2013-11-07 22:31:54 +00:00
mikrotik
nand ar71xx: move WNDR4300 profile to the nand subtarget 2013-11-04 18:37:09 +00:00
patches-3.10 ar71xx: add kernel support for the My Net Wi-Fi Range Extender device 2013-11-07 22:31:52 +00:00
base-files.mk
config-3.10 ar71xx: add kernel support for the My Net Wi-Fi Range Extender device 2013-11-07 22:31:52 +00:00
Makefile kernel: update 3.10 to 3.10.18 2013-11-05 08:25:45 +00:00
modules.mk ar71xx: always enable hw ecc support for the ar934x-nfc module 2013-11-01 18:33:18 +00:00