aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-06-05 21:31:16 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-06 16:22:51 -0400
commitd220b942a4b6a0640aee78841608f4aa5e8e185e (patch)
tree92eee1af3dffa61287c917453c3b59ca01b58f87
parent1020ce3108cc26fbf09d70550ea2937cb1a211d2 (diff)
net: ethoc: enable NAPI before poll may be scheduled
ethoc_reset enables device interrupts, ethoc_interrupt may schedule a NAPI poll before NAPI is enabled in the ethoc_open, which results in device being unable to send or receive anything until it's closed and reopened. In case the device is flooded with ingress packets it may be unable to recover at all. Move napi_enable above ethoc_reset in the ethoc_open to fix that. Fixes: a1702857724f ("net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.") Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tobias Klauser <tklauser@distanz.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/ethoc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index e863ba74d005..8bb0db990c8f 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -739,6 +739,8 @@ static int ethoc_open(struct net_device *dev)
739 if (ret) 739 if (ret)
740 return ret; 740 return ret;
741 741
742 napi_enable(&priv->napi);
743
742 ethoc_init_ring(priv, dev->mem_start); 744 ethoc_init_ring(priv, dev->mem_start);
743 ethoc_reset(priv); 745 ethoc_reset(priv);
744 746
@@ -754,7 +756,6 @@ static int ethoc_open(struct net_device *dev)
754 priv->old_duplex = -1; 756 priv->old_duplex = -1;
755 757
756 phy_start(dev->phydev); 758 phy_start(dev->phydev);
757 napi_enable(&priv->napi);
758 759
759 if (netif_msg_ifup(priv)) { 760 if (netif_msg_ifup(priv)) {
760 dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n", 761 dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",