aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2017-01-25 20:38:34 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-25 22:47:30 -0500
commit7489bdadb7d17d3c81e39b85688500f700beb790 (patch)
tree79ca0e6d3f49de50e4f20e4724400dbd47df5ba4
parent248b213ad908b88db15941202ef7cb7eb137c1a0 (diff)
r8152: check rx after napi is enabled
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>
-rw-r--r--drivers/net/usb/r8152.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 4785d2b9d80f..ad42295356dd 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -32,7 +32,7 @@
32#define NETNEXT_VERSION "08" 32#define NETNEXT_VERSION "08"
33 33
34/* Information for net */ 34/* Information for net */
35#define NET_VERSION "7" 35#define NET_VERSION "8"
36 36
37#define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION 37#define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION
38#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" 38#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
@@ -3561,6 +3561,9 @@ static int rtl8152_post_reset(struct usb_interface *intf)
3561 netif_wake_queue(netdev); 3561 netif_wake_queue(netdev);
3562 usb_submit_urb(tp->intr_urb, GFP_KERNEL); 3562 usb_submit_urb(tp->intr_urb, GFP_KERNEL);
3563 3563
3564 if (!list_empty(&tp->rx_done))
3565 napi_schedule(&tp->napi);
3566
3564 return 0; 3567 return 0;
3565} 3568}
3566 3569
@@ -3700,6 +3703,8 @@ static int rtl8152_resume(struct usb_interface *intf)
3700 napi_enable(&tp->napi); 3703 napi_enable(&tp->napi);
3701 clear_bit(SELECTIVE_SUSPEND, &tp->flags); 3704 clear_bit(SELECTIVE_SUSPEND, &tp->flags);
3702 smp_mb__after_atomic(); 3705 smp_mb__after_atomic();
3706 if (!list_empty(&tp->rx_done))
3707 napi_schedule(&tp->napi);
3703 } else { 3708 } else {
3704 tp->rtl_ops.up(tp); 3709 tp->rtl_ops.up(tp);
3705 netif_carrier_off(tp->netdev); 3710 netif_carrier_off(tp->netdev);