Commit 2f516d52 authored by David S. Miller's avatar David S. Miller

Merge branch 'r8152-next'

Hayes Wang says:

====================
r8152: adjust r8152_submit_rx

v2:
Replace the patch #1 with "call rtl_start_rx after netif_carrier_on".

For patch #2, replace checking tp->speed with netif_carrier_ok.

v1:
Avoid r8152_submit_rx() from submitting rx during unexpected
moment. This could reduce the time of stopping rx.

For patch #1, the tp->speed should be updated early. Then,
the patch #2 could use it to check the current linking status.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3bf39475 ef827a5b
...@@ -1789,6 +1789,11 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags) ...@@ -1789,6 +1789,11 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
{ {
int ret; int ret;
/* The rx would be stopped, so skip submitting */
if (test_bit(RTL8152_UNPLUG, &tp->flags) ||
!test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev))
return 0;
usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1), usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1),
agg->head, agg_buf_sz, agg->head, agg_buf_sz,
(usb_complete_t)read_bulk_callback, agg); (usb_complete_t)read_bulk_callback, agg);
...@@ -2059,7 +2064,7 @@ static int rtl_enable(struct r8152 *tp) ...@@ -2059,7 +2064,7 @@ static int rtl_enable(struct r8152 *tp)
rxdy_gated_en(tp, false); rxdy_gated_en(tp, false);
return rtl_start_rx(tp); return 0;
} }
static int rtl8152_enable(struct r8152 *tp) static int rtl8152_enable(struct r8152 *tp)
...@@ -2874,6 +2879,7 @@ static void set_carrier(struct r8152 *tp) ...@@ -2874,6 +2879,7 @@ static void set_carrier(struct r8152 *tp)
tp->rtl_ops.enable(tp); tp->rtl_ops.enable(tp);
set_bit(RTL8152_SET_RX_MODE, &tp->flags); set_bit(RTL8152_SET_RX_MODE, &tp->flags);
netif_carrier_on(netdev); netif_carrier_on(netdev);
rtl_start_rx(tp);
} }
} else { } else {
if (tp->speed & LINK_STATUS) { if (tp->speed & LINK_STATUS) {
......
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