Commit 7489bdad authored by hayeswang's avatar hayeswang Committed by David S. Miller

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: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 248b213a
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define NETNEXT_VERSION "08" #define NETNEXT_VERSION "08"
/* Information for net */ /* Information for net */
#define NET_VERSION "7" #define NET_VERSION "8"
#define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION #define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION
#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" #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,6 +3561,9 @@ static int rtl8152_post_reset(struct usb_interface *intf)
netif_wake_queue(netdev); netif_wake_queue(netdev);
usb_submit_urb(tp->intr_urb, GFP_KERNEL); usb_submit_urb(tp->intr_urb, GFP_KERNEL);
if (!list_empty(&tp->rx_done))
napi_schedule(&tp->napi);
return 0; return 0;
} }
...@@ -3700,6 +3703,8 @@ static int rtl8152_resume(struct usb_interface *intf) ...@@ -3700,6 +3703,8 @@ static int rtl8152_resume(struct usb_interface *intf)
napi_enable(&tp->napi); napi_enable(&tp->napi);
clear_bit(SELECTIVE_SUSPEND, &tp->flags); clear_bit(SELECTIVE_SUSPEND, &tp->flags);
smp_mb__after_atomic(); smp_mb__after_atomic();
if (!list_empty(&tp->rx_done))
napi_schedule(&tp->napi);
} else { } else {
tp->rtl_ops.up(tp); tp->rtl_ops.up(tp);
netif_carrier_off(tp->netdev); netif_carrier_off(tp->netdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment