Skip to content

Commit d220b94

Browse files
jcmvbkbcdavem330
authored andcommitted
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: a170285 ("net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.") Signed-off-by: Max Filippov <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1020ce3 commit d220b94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/ethoc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ static int ethoc_open(struct net_device *dev)
739739
if (ret)
740740
return ret;
741741

742+
napi_enable(&priv->napi);
743+
742744
ethoc_init_ring(priv, dev->mem_start);
743745
ethoc_reset(priv);
744746

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

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

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

0 commit comments

Comments
 (0)