diff options
author | hayeswang <hayeswang@realtek.com> | 2014-02-06 11:55:48 +0800 |
---|---|---|
committer | Preetham Chandru <pchandru@nvidia.com> | 2014-02-21 02:56:29 -0800 |
commit | 2bec01111213048f20b820b0db3735014f714477 (patch) | |
tree | 3c8e8f6e72de41dd9a1e254681a7445f6afcd033 /drivers/net/usb | |
parent | 1fe063da9bf91a7a1c9cdca5e13c51260df7e493 (diff) |
r8152: fix the submission of the interrupt transfer
The submission of the interrupt transfer should be done after setting
the bit of WORK_ENABLE, otherwise the callback function would have
the opportunity to be returned directly.
Clear the bit of WORK_ENABLE before killing the interrupt transfer.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
(cherry picked from commit 3d55f44f563de2ab83209e8ead48d922b0d56a65)
Change-Id: Ida14be15f0dd14fe76e2895d6d6b39aa0283c126
Reviewed-on: http://git-master/r/370013
Tested-by: Aly Hirani <ahirani@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/r8152.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index eab078b6e603..a28120031a95 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -2271,22 +2271,21 @@ static int rtl8152_open(struct net_device *netdev) struct r8152 *tp = netdev_priv(netdev); int res = 0; + rtl8152_set_speed(tp, AUTONEG_ENABLE, + tp->mii.supports_gmii ? SPEED_1000 : SPEED_100, + DUPLEX_FULL); + tp->speed = 0; + netif_carrier_off(netdev); + netif_start_queue(netdev); + set_bit(WORK_ENABLE, &tp->flags); res = usb_submit_urb(tp->intr_urb, GFP_KERNEL); if (res) { if (res == -ENODEV) netif_device_detach(tp->netdev); netif_warn(tp, ifup, netdev, "intr_urb submit failed: %d\n", res); - return res; } - rtl8152_set_speed(tp, AUTONEG_ENABLE, - tp->mii.supports_gmii ? SPEED_1000 : SPEED_100, - DUPLEX_FULL); - tp->speed = 0; - netif_carrier_off(netdev); - netif_start_queue(netdev); - set_bit(WORK_ENABLE, &tp->flags); return res; } @@ -2296,8 +2295,8 @@ static int rtl8152_close(struct net_device *netdev) struct r8152 *tp = netdev_priv(netdev); int res = 0; - usb_kill_urb(tp->intr_urb); clear_bit(WORK_ENABLE, &tp->flags); + usb_kill_urb(tp->intr_urb); cancel_delayed_work_sync(&tp->schedule); netif_stop_queue(netdev); tasklet_disable(&tp->tl); |