summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ethoc.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-06-05 18:31:16 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-14 15:05:52 +0200
commita83564d128637c99d454cc1918b69ca84b9ce688 (patch)
treeb9a6ded2f703dfbc9d950902dbe714b411a5697e /drivers/net/ethernet/ethoc.c
parenta97f807363d4f3c8c849a0e12064305d5bb5a6dc (diff)
net: ethoc: enable NAPI before poll may be scheduled
[ Upstream commit d220b942a4b6a0640aee78841608f4aa5e8e185e ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet/ethoc.c')
-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 c044667a0a25..e31199f3048c 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -710,6 +710,8 @@ static int ethoc_open(struct net_device *dev)
if (ret)
return ret;
+ napi_enable(&priv->napi);
+
ethoc_init_ring(priv, dev->mem_start);
ethoc_reset(priv);
@@ -722,7 +724,6 @@ static int ethoc_open(struct net_device *dev)
}
phy_start(dev->phydev);
- napi_enable(&priv->napi);
if (netif_msg_ifup(priv)) {
dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",