Commit 93ffbeab authored by hayeswang's avatar hayeswang Committed by David S. Miller

r8152: disable the tasklet by default

Let the tasklet only be enabled after open(), and be disabled for
the other situation. The tasklet is only necessary after open() for
tx/rx, so it could be disabled by default.
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c672e4b
...@@ -2943,6 +2943,8 @@ static int rtl8152_open(struct net_device *netdev) ...@@ -2943,6 +2943,8 @@ static int rtl8152_open(struct net_device *netdev)
netif_warn(tp, ifup, netdev, "intr_urb submit failed: %d\n", netif_warn(tp, ifup, netdev, "intr_urb submit failed: %d\n",
res); res);
free_all_mem(tp); free_all_mem(tp);
} else {
tasklet_enable(&tp->tl);
} }
mutex_unlock(&tp->control); mutex_unlock(&tp->control);
...@@ -2958,6 +2960,7 @@ static int rtl8152_close(struct net_device *netdev) ...@@ -2958,6 +2960,7 @@ static int rtl8152_close(struct net_device *netdev)
struct r8152 *tp = netdev_priv(netdev); struct r8152 *tp = netdev_priv(netdev);
int res = 0; int res = 0;
tasklet_disable(&tp->tl);
clear_bit(WORK_ENABLE, &tp->flags); clear_bit(WORK_ENABLE, &tp->flags);
usb_kill_urb(tp->intr_urb); usb_kill_urb(tp->intr_urb);
cancel_delayed_work_sync(&tp->schedule); cancel_delayed_work_sync(&tp->schedule);
...@@ -2975,9 +2978,7 @@ static int rtl8152_close(struct net_device *netdev) ...@@ -2975,9 +2978,7 @@ static int rtl8152_close(struct net_device *netdev)
*/ */
rtl_runtime_suspend_enable(tp, false); rtl_runtime_suspend_enable(tp, false);
tasklet_disable(&tp->tl);
tp->rtl_ops.down(tp); tp->rtl_ops.down(tp);
tasklet_enable(&tp->tl);
mutex_unlock(&tp->control); mutex_unlock(&tp->control);
...@@ -3887,12 +3888,15 @@ static int rtl8152_probe(struct usb_interface *intf, ...@@ -3887,12 +3888,15 @@ static int rtl8152_probe(struct usb_interface *intf,
else else
device_set_wakeup_enable(&udev->dev, false); device_set_wakeup_enable(&udev->dev, false);
tasklet_disable(&tp->tl);
netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION); netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION);
return 0; return 0;
out1: out1:
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
tasklet_kill(&tp->tl);
out: out:
free_netdev(netdev); free_netdev(netdev);
return ret; return ret;
......
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