提交 d220b942 编写于 作者: M Max Filippov 提交者: David S. Miller

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: a1702857 ("net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.")
Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
Reviewed-by: NTobias Klauser <tklauser@distanz.ch>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1020ce31
...@@ -739,6 +739,8 @@ static int ethoc_open(struct net_device *dev) ...@@ -739,6 +739,8 @@ static int ethoc_open(struct net_device *dev)
if (ret) if (ret)
return ret; return ret;
napi_enable(&priv->napi);
ethoc_init_ring(priv, dev->mem_start); ethoc_init_ring(priv, dev->mem_start);
ethoc_reset(priv); ethoc_reset(priv);
...@@ -754,7 +756,6 @@ static int ethoc_open(struct net_device *dev) ...@@ -754,7 +756,6 @@ static int ethoc_open(struct net_device *dev)
priv->old_duplex = -1; priv->old_duplex = -1;
phy_start(dev->phydev); phy_start(dev->phydev);
napi_enable(&priv->napi);
if (netif_msg_ifup(priv)) { if (netif_msg_ifup(priv)) {
dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n", dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册