diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-11-08 08:17:54 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2013-11-08 08:17:54 +0000 |
commit | c389aa40d8bf1d12ff7892b01a7dd0e50e7e3832 (patch) | |
tree | 2aae8306c7c7dfc2b084c4c4c2d186ae68c358a5 /package/kernel | |
parent | ee168f7c39daddeca1e65c1a394f38bf1210b81c (diff) | |
download | upstream-c389aa40d8bf1d12ff7892b01a7dd0e50e7e3832.tar.gz upstream-c389aa40d8bf1d12ff7892b01a7dd0e50e7e3832.tar.bz2 upstream-c389aa40d8bf1d12ff7892b01a7dd0e50e7e3832.zip |
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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38689 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel')
0 files changed, 0 insertions, 0 deletions