net: ethoc: enable NAPI before poll may be scheduled
Subsystems (3)
PATCH 1/1 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.
--- drivers/net/ethernet/ethoc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/ethoc.c +2 -1
@@ -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);
@@ -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",
Signature · 1 line
2.1.4
Quoted 9 lines · Max Filippov
ethoc_resetenables device interrupts,ethoc_interruptmay schedule a NAPI poll before NAPI is enabled in theethoc_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.
Movenapi_enableaboveethoc_resetin theethoc_opento fix that.Signed-off-by Max Filippov <[email protected]>
Quoted 9 lines · Max Filippov
ethoc_resetenables device interrupts,ethoc_interruptmay schedule a NAPI poll before NAPI is enabled in theethoc_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.
Movenapi_enableaboveethoc_resetin theethoc_opento fix that.Signed-off-by Max Filippov <[email protected]>
Ethernet MAC.")
Signature · 1 line
Florian
David Miller
maintainerFrom: Max Filippov <[email protected]>
Date: Mon, 5 Jun 2017 18:31:16 -0700
Quoted 9 lines
ethoc_resetenables device interrupts,ethoc_interruptmay schedule a NAPI poll before NAPI is enabled in theethoc_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.
Movenapi_enableaboveethoc_resetin theethoc_opento fix that.Signed-off-by Max Filippov <[email protected]>
Applied and queued up for -stable.