Merge branch 'r8152-next'
Hayes Wang says: ==================== Code adjustment v3: Remove the test_bit for patch #2. v2: Correct the spelling error for the comment of patch #3. v1: Adjust some codes to make them more reasonable. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
feed1a9660
|
@ -1255,7 +1255,6 @@ static int alloc_all_mem(struct r8152 *tp)
|
||||||
|
|
||||||
spin_lock_init(&tp->rx_lock);
|
spin_lock_init(&tp->rx_lock);
|
||||||
spin_lock_init(&tp->tx_lock);
|
spin_lock_init(&tp->tx_lock);
|
||||||
INIT_LIST_HEAD(&tp->rx_done);
|
|
||||||
INIT_LIST_HEAD(&tp->tx_free);
|
INIT_LIST_HEAD(&tp->tx_free);
|
||||||
skb_queue_head_init(&tp->tx_queue);
|
skb_queue_head_init(&tp->tx_queue);
|
||||||
|
|
||||||
|
@ -1798,6 +1797,8 @@ static void bottom_half(unsigned long data)
|
||||||
if (!netif_carrier_ok(tp->netdev))
|
if (!netif_carrier_ok(tp->netdev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
clear_bit(SCHEDULE_TASKLET, &tp->flags);
|
||||||
|
|
||||||
rx_bottom(tp);
|
rx_bottom(tp);
|
||||||
tx_bottom(tp);
|
tx_bottom(tp);
|
||||||
}
|
}
|
||||||
|
@ -2856,15 +2857,18 @@ static void rtl_work_func_t(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct r8152 *tp = container_of(work, struct r8152, schedule.work);
|
struct r8152 *tp = container_of(work, struct r8152, schedule.work);
|
||||||
|
|
||||||
|
/* If the device is unplugged or !netif_running(), the workqueue
|
||||||
|
* doesn't need to wake the device, and could return directly.
|
||||||
|
*/
|
||||||
|
if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev))
|
||||||
|
return;
|
||||||
|
|
||||||
if (usb_autopm_get_interface(tp->intf) < 0)
|
if (usb_autopm_get_interface(tp->intf) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
if (!test_bit(WORK_ENABLE, &tp->flags))
|
||||||
goto out1;
|
goto out1;
|
||||||
|
|
||||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
goto out1;
|
|
||||||
|
|
||||||
if (!mutex_trylock(&tp->control)) {
|
if (!mutex_trylock(&tp->control)) {
|
||||||
schedule_delayed_work(&tp->schedule, 0);
|
schedule_delayed_work(&tp->schedule, 0);
|
||||||
goto out1;
|
goto out1;
|
||||||
|
|
Loading…
Reference in New Issue