aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFugang Duan <B38611@freescale.com>2014-03-17 01:59:00 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:58:00 -0400
commit4e7c655740468be56a2a5d0f0980a940ae8ea908 (patch)
treeed251e2d3326430a7d30610af660c89898076775
parent2b5491d57d36176bd82036226c6c750f30ee1a27 (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>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c3
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)
2079 2079
2080 fec_enet_clk_enable(ndev, true); 2080 fec_enet_clk_enable(ndev, true);
2081 2081
2082 napi_enable(&fep->napi);
2083
2084 /* I should reset the ring buffers here, but I don't yet know 2082 /* I should reset the ring buffers here, but I don't yet know
2085 * a simple way to do that. 2083 * a simple way to do that.
2086 */ 2084 */
@@ -2096,6 +2094,7 @@ fec_enet_open(struct net_device *ndev)
2096 return ret; 2094 return ret;
2097 } 2095 }
2098 2096
2097 napi_enable(&fep->napi);
2099 phy_start(fep->phy_dev); 2098 phy_start(fep->phy_dev);
2100 netif_tx_start_all_queues(ndev); 2099 netif_tx_start_all_queues(ndev);
2101 fep->opened = 1; 2100 fep->opened = 1;