diff options
author | Fugang Duan <B38611@freescale.com> | 2014-03-17 13:59:00 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 08:58:00 -0500 |
commit | 4e7c655740468be56a2a5d0f0980a940ae8ea908 (patch) | |
tree | ed251e2d3326430a7d30610af660c89898076775 /drivers/net | |
parent | 2b5491d57d36176bd82036226c6c750f30ee1a27 (diff) |
NET: fec: only enable napi if we are successful
If napi is left enabled after a failed attempt to bring the interface
up, we BUG:
fec 2188000.ethernet eth0: no PHY, assuming direct connection to switch
libphy: PHY fixed-0:00 not found
fec 2188000.ethernet eth0: could not attach to PHY
------------[ cut here ]------------
kernel BUG at include/linux/netdevice.h:502!
Internal error: Oops - BUG: 0 [#1] SMP ARM
...
PC is at fec_enet_open+0x4d0/0x500
LR is at __dev_open+0xa4/0xfc
Only enable napi after we are past all the failure paths.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index e3ffd7aee02f..f49f43fef2aa 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2079,8 +2079,6 @@ fec_enet_open(struct net_device *ndev) fec_enet_clk_enable(ndev, true); - napi_enable(&fep->napi); - /* I should reset the ring buffers here, but I don't yet know * a simple way to do that. */ @@ -2096,6 +2094,7 @@ fec_enet_open(struct net_device *ndev) return ret; } + napi_enable(&fep->napi); phy_start(fep->phy_dev); netif_tx_start_all_queues(ndev); fep->opened = 1; |