netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ethoc: enable NAPI before poll may be scheduled
@ 2017-06-06  1:31 Max Filippov
  2017-06-06  6:05 ` Tobias Klauser
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Max Filippov @ 2017-06-06  1:31 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Florian Fainelli, Thierry Reding, Tobias Klauser,
	Max Filippov, stable

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.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 drivers/net/ethernet/ethoc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 23d8274..4f33660 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -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",
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ethoc: enable NAPI before poll may be scheduled
  2017-06-06  1:31 [PATCH] net: ethoc: enable NAPI before poll may be scheduled Max Filippov
@ 2017-06-06  6:05 ` Tobias Klauser
  2017-06-06 14:26 ` Florian Fainelli
  2017-06-06 20:24 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Tobias Klauser @ 2017-06-06  6:05 UTC (permalink / raw)
  To: Max Filippov
  Cc: netdev, David S. Miller, Florian Fainelli, Thierry Reding, stable

On 2017-06-06 at 03:31:16 +0200, Max Filippov <jcmvbkbc@gmail.com> wrote:
> 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.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Reviewed-by: Tobias Klauser <tklauser@distanz.ch>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ethoc: enable NAPI before poll may be scheduled
  2017-06-06  1:31 [PATCH] net: ethoc: enable NAPI before poll may be scheduled Max Filippov
  2017-06-06  6:05 ` Tobias Klauser
@ 2017-06-06 14:26 ` Florian Fainelli
  2017-06-06 20:24 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2017-06-06 14:26 UTC (permalink / raw)
  To: Max Filippov, netdev
  Cc: David S. Miller, Thierry Reding, Tobias Klauser, stable



On 06/05/2017 06:31 PM, Max Filippov wrote:
> 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.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Fixes: a1702857724f ("net: Add support for the OpenCores 10/100 Mbps
Ethernet MAC.")

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ethoc: enable NAPI before poll may be scheduled
  2017-06-06  1:31 [PATCH] net: ethoc: enable NAPI before poll may be scheduled Max Filippov
  2017-06-06  6:05 ` Tobias Klauser
  2017-06-06 14:26 ` Florian Fainelli
@ 2017-06-06 20:24 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-06-06 20:24 UTC (permalink / raw)
  To: jcmvbkbc; +Cc: netdev, f.fainelli, thierry.reding, tklauser, stable

From: Max Filippov <jcmvbkbc@gmail.com>
Date: Mon,  5 Jun 2017 18:31:16 -0700

> 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.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-06 20:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-06  1:31 [PATCH] net: ethoc: enable NAPI before poll may be scheduled Max Filippov
2017-06-06  6:05 ` Tobias Klauser
2017-06-06 14:26 ` Florian Fainelli
2017-06-06 20:24 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).