Skip to content

Commit

Permalink
net: ethoc: enable NAPI before poll may be scheduled
Browse files Browse the repository at this point in the history
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: a170285 ("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>
  • Loading branch information
Max Filippov authored and David S. Miller committed Jun 6, 2017
1 parent 1020ce3 commit d220b94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,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);

Expand All @@ -754,7 +756,6 @@ static int ethoc_open(struct net_device *dev)
priv->old_duplex = -1;

phy_start(dev->phydev);
napi_enable(&priv->napi);

if (netif_msg_ifup(priv)) {
dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",
Expand Down

0 comments on commit d220b94

Please sign in to comment.