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


Groups > linux.kernel > #1667057 > unrolled thread

[PATCH 4.9 069/108] r8152: check rx after napi is enabled

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-06-15 20:20 +0200
Last post2017-06-15 20:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.9 069/108] r8152: check rx after napi is enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-15 20:20 +0200

#1667057 — [PATCH 4.9 069/108] r8152: check rx after napi is enabled

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-06-15 20:20 +0200
Subject[PATCH 4.9 069/108] r8152: check rx after napi is enabled
Message-ID<tSHxa-5SK-63@gated-at.bofh.it>
4.9-stable review patch.  If anyone has any objections, please let me know.

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

From: hayeswang <hayeswang@realtek.com>


[ Upstream commit 7489bdadb7d17d3c81e39b85688500f700beb790 ]

Schedule the napi after napi_enable() for rx, if it is necessary.

If the rx is completed when napi is disabled, the sheduling of napi
would be lost. Then, no one handles the rx packet until next napi
is scheduled.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/usb/r8152.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -32,7 +32,7 @@
 #define NETNEXT_VERSION		"08"
 
 /* Information for net */
-#define NET_VERSION		"7"
+#define NET_VERSION		"8"
 
 #define DRIVER_VERSION		"v1." NETNEXT_VERSION "." NET_VERSION
 #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
@@ -3552,6 +3552,9 @@ static int rtl8152_post_reset(struct usb
 
 	napi_enable(&tp->napi);
 
+	if (!list_empty(&tp->rx_done))
+		napi_schedule(&tp->napi);
+
 	return 0;
 }
 
@@ -3691,6 +3694,8 @@ static int rtl8152_resume(struct usb_int
 			napi_enable(&tp->napi);
 			clear_bit(SELECTIVE_SUSPEND, &tp->flags);
 			smp_mb__after_atomic();
+			if (!list_empty(&tp->rx_done))
+				napi_schedule(&tp->napi);
 		} else {
 			tp->rtl_ops.up(tp);
 			netif_carrier_off(tp->netdev);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web