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


Groups > linux.kernel > #1566299

[PATCH net 4/4] r8152: check rx after napi is enabled

From Hayes Wang <hayeswang@realtek.com>
Newsgroups linux.kernel
Subject [PATCH net 4/4] r8152: check rx after napi is enabled
Date 2017-01-25 04:00 +0100
Message-ID <t3lYu-4hv-13@gated-at.bofh.it> (permalink)
References <t3lYu-4hv-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/net/usb/r8152.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index f65109b..f0f55b3 100644
--- 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>"
@@ -3561,6 +3561,9 @@ static int rtl8152_post_reset(struct usb_interface *intf)
 	netif_wake_queue(netdev);
 	usb_submit_urb(tp->intr_urb, GFP_KERNEL);
 
+	if (!list_empty(&tp->rx_done))
+		napi_schedule(&tp->napi);
+
 	return 0;
 }
 
@@ -3696,6 +3699,8 @@ static int rtl8152_resume(struct usb_interface *intf)
 				rtl_start_rx(tp);
 			napi_enable(&tp->napi);
 			clear_bit(SELECTIVE_SUSPEND, &tp->flags);
+			if (!list_empty(&tp->rx_done))
+				napi_schedule(&tp->napi);
 		} else {
 			tp->rtl_ops.up(tp);
 			netif_carrier_off(tp->netdev);
-- 
2.7.4

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


Thread

[PATCH net 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
  [PATCH net 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
    Re: [PATCH net 1/4] r8152: avoid start_xmit to call napi_schedule  during autosuspend Stephen Hemminger <stephen@networkplumber.org> - 2017-01-25 06:10 +0100
  [PATCH net 4/4] r8152: check rx after napi is enabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
  [PATCH net 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
  [PATCH net 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
  [PATCH net v2 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
    [PATCH net v2 4/4] r8152: check rx after napi is enabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
    [PATCH net v2 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
      Re: [PATCH net v2 3/4] r8152: re-schedule napi for tx Eric Dumazet <eric.dumazet@gmail.com> - 2017-01-25 15:00 +0100
        RE: [PATCH net v2 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:30 +0100
    [PATCH net v2 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
    [PATCH net v2 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
    Re: [PATCH net v2 0/4] r8152: fix scheduling napi David Miller <davem@davemloft.net> - 2017-01-25 20:40 +0100
      RE: [PATCH net v2 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-26 04:10 +0100
        Re: [PATCH net v2 0/4] r8152: fix scheduling napi David Miller <davem@davemloft.net> - 2017-01-26 04:50 +0100
  [PATCH net v3 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
  [PATCH net v3 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
  [PATCH net v3 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
  [PATCH net v3 4/4] r8152: check rx after napi is enabled Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
  [PATCH net v3 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:50 +0100
    Re: [PATCH net v3 0/4] r8152: fix scheduling napi David Miller <davem@davemloft.net> - 2017-01-26 04:50 +0100
      RE: [PATCH net v3 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-26 05:00 +0100

csiph-web