Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1663876

[PATCH 4.4 08/90] net: ethoc: enable NAPI before poll may be scheduled

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 08/90] net: ethoc: enable NAPI before poll may be scheduled
Date 2017-06-12 18:20 +0200
Message-ID <tRAep-4ne-87@gated-at.bofh.it> (permalink)
References <tRzBD-3Tq-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Max Filippov <jcmvbkbc@gmail.com>


[ Upstream commit d220b942a4b6a0640aee78841608f4aa5e8e185e ]

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: a1702857724f ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/ethoc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -713,6 +713,8 @@ static int ethoc_open(struct net_device
 	if (ret)
 		return ret;
 
+	napi_enable(&priv->napi);
+
 	ethoc_init_ring(priv, dev->mem_start);
 	ethoc_reset(priv);
 
@@ -725,7 +727,6 @@ static int ethoc_open(struct net_device
 	}
 
 	phy_start(priv->phy);
-	napi_enable(&priv->napi);
 
 	if (netif_msg_ifup(priv)) {
 		dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 00/90] 4.4.72-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 07/90] net: ping: do not abuse udp_poll() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 33/90] xen/privcmd: Support correctly 64KB page granularity when mapping memory Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 48/90] cpufreq: cpufreq_register_driver() should return -ENODEV if init fails Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 47/90] stackprotector: Increase the per-task stack canarys random range from 32 bits to 64 bits on 64-bit platforms Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 17/90] sparc64: delete old wrap code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 32/90] dmaengine: ep93xx: Always start from BASE0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 12/90] sparc64: reset mm cpumask after wrap Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 02/90] ipv6: xfrm: Handle errors reported by xfrm6_find_1stfragopt() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 26/90] nfsd: Fix up the "supattr_exclcreat" attributes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 10/90] sparc64: mm: fix copy_tsb to correctly copy huge page TSBs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 51/90] Input: elantech - add Fujitsu Lifebook E546/E557 to force crc_enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 20/90] ptrace: Properly initialize ptracer_cred on fork Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 43/90] iio: light: ltr501 Fix interchanged als/ps register field Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 13/90] sparc64: combine activate_mm and switch_mm Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 49/90] target: Re-add check to reject control WRITEs with overflow data Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 11/90] sparc: Machine description indices can vary Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 19/90] serial: ifx6x60: fix use-after-free on module unload Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 03/90] cxgb4: avoid enabling napi twice to the same queue Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 21/90] KEYS: fix dereferencing NULL payload with nonzero length Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  [PATCH 4.4 08/90] net: ethoc: enable NAPI before poll may be scheduled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 18:20 +0200
  Re: [PATCH 4.4 00/90] 4.4.72-stable review Guenter Roeck <linux@roeck-us.net> - 2017-06-13 00:00 +0200
  Re: [PATCH 4.4 00/90] 4.4.72-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-06-13 02:50 +0200

csiph-web