diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2012-01-26 05:23:32 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2012-01-27 03:57:45 -0500 |
commit | 4422bcd4907d1bbb9f63e049e3c3819132c047a1 (patch) | |
tree | 71ace7f9b99d17709b38a629160bc8874914d2d4 | |
parent | 209e5ac83b4d038ffb52cabc793f75031602a031 (diff) |
r8169: stop delaying workqueue.
Though motivated by the move of the driver to a single work queue of
sequential events and removal of hard irq processing, it looks safe as
a standalone change.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 4f0856b8fab3..6d74931049fb 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -714,7 +714,11 @@ struct rtl8169_private { | |||
714 | unsigned int (*phy_reset_pending)(struct rtl8169_private *tp); | 714 | unsigned int (*phy_reset_pending)(struct rtl8169_private *tp); |
715 | unsigned int (*link_ok)(void __iomem *); | 715 | unsigned int (*link_ok)(void __iomem *); |
716 | int (*do_ioctl)(struct rtl8169_private *tp, struct mii_ioctl_data *data, int cmd); | 716 | int (*do_ioctl)(struct rtl8169_private *tp, struct mii_ioctl_data *data, int cmd); |
717 | struct delayed_work task; | 717 | |
718 | struct { | ||
719 | struct work_struct work; | ||
720 | } wk; | ||
721 | |||
718 | unsigned features; | 722 | unsigned features; |
719 | 723 | ||
720 | struct mii_if_info mii; | 724 | struct mii_if_info mii; |
@@ -4194,7 +4198,7 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | |||
4194 | rtl8168_driver_stop(tp); | 4198 | rtl8168_driver_stop(tp); |
4195 | } | 4199 | } |
4196 | 4200 | ||
4197 | cancel_delayed_work_sync(&tp->task); | 4201 | cancel_work_sync(&tp->wk.work); |
4198 | 4202 | ||
4199 | unregister_netdev(dev); | 4203 | unregister_netdev(dev); |
4200 | 4204 | ||
@@ -4255,6 +4259,8 @@ static void rtl_request_firmware(struct rtl8169_private *tp) | |||
4255 | rtl_request_uncached_firmware(tp); | 4259 | rtl_request_uncached_firmware(tp); |
4256 | } | 4260 | } |
4257 | 4261 | ||
4262 | static void rtl_task(struct work_struct *); | ||
4263 | |||
4258 | static int rtl8169_open(struct net_device *dev) | 4264 | static int rtl8169_open(struct net_device *dev) |
4259 | { | 4265 | { |
4260 | struct rtl8169_private *tp = netdev_priv(dev); | 4266 | struct rtl8169_private *tp = netdev_priv(dev); |
@@ -4282,7 +4288,7 @@ static int rtl8169_open(struct net_device *dev) | |||
4282 | if (retval < 0) | 4288 | if (retval < 0) |
4283 | goto err_free_rx_1; | 4289 | goto err_free_rx_1; |
4284 | 4290 | ||
4285 | INIT_DELAYED_WORK(&tp->task, NULL); | 4291 | INIT_WORK(&tp->wk.work, rtl_task); |
4286 | 4292 | ||
4287 | smp_mb(); | 4293 | smp_mb(); |
4288 | 4294 | ||
@@ -5328,12 +5334,11 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp) | |||
5328 | tp->cur_tx = tp->dirty_tx = 0; | 5334 | tp->cur_tx = tp->dirty_tx = 0; |
5329 | } | 5335 | } |
5330 | 5336 | ||
5331 | static void rtl8169_schedule_work(struct net_device *dev, work_func_t task) | 5337 | static void rtl8169_schedule_work(struct net_device *dev) |
5332 | { | 5338 | { |
5333 | struct rtl8169_private *tp = netdev_priv(dev); | 5339 | struct rtl8169_private *tp = netdev_priv(dev); |
5334 | 5340 | ||
5335 | PREPARE_DELAYED_WORK(&tp->task, task); | 5341 | schedule_work(&tp->wk.work); |
5336 | schedule_delayed_work(&tp->task, 4); | ||
5337 | } | 5342 | } |
5338 | 5343 | ||
5339 | static void rtl8169_wait_for_quiescence(struct net_device *dev) | 5344 | static void rtl8169_wait_for_quiescence(struct net_device *dev) |
@@ -5353,10 +5358,8 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev) | |||
5353 | napi_enable(&tp->napi); | 5358 | napi_enable(&tp->napi); |
5354 | } | 5359 | } |
5355 | 5360 | ||
5356 | static void rtl8169_reset_task(struct work_struct *work) | 5361 | static void rtl_reset_work(struct rtl8169_private *tp) |
5357 | { | 5362 | { |
5358 | struct rtl8169_private *tp = | ||
5359 | container_of(work, struct rtl8169_private, task.work); | ||
5360 | struct net_device *dev = tp->dev; | 5363 | struct net_device *dev = tp->dev; |
5361 | int i; | 5364 | int i; |
5362 | 5365 | ||
@@ -5385,7 +5388,7 @@ out_unlock: | |||
5385 | 5388 | ||
5386 | static void rtl8169_tx_timeout(struct net_device *dev) | 5389 | static void rtl8169_tx_timeout(struct net_device *dev) |
5387 | { | 5390 | { |
5388 | rtl8169_schedule_work(dev, rtl8169_reset_task); | 5391 | rtl8169_schedule_work(dev); |
5389 | } | 5392 | } |
5390 | 5393 | ||
5391 | static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, | 5394 | static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, |
@@ -5588,7 +5591,7 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev) | |||
5588 | 5591 | ||
5589 | rtl8169_hw_reset(tp); | 5592 | rtl8169_hw_reset(tp); |
5590 | 5593 | ||
5591 | rtl8169_schedule_work(dev, rtl8169_reset_task); | 5594 | rtl8169_schedule_work(dev); |
5592 | } | 5595 | } |
5593 | 5596 | ||
5594 | static void rtl8169_tx_interrupt(struct net_device *dev, | 5597 | static void rtl8169_tx_interrupt(struct net_device *dev, |
@@ -5707,7 +5710,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
5707 | if (status & RxCRC) | 5710 | if (status & RxCRC) |
5708 | dev->stats.rx_crc_errors++; | 5711 | dev->stats.rx_crc_errors++; |
5709 | if (status & RxFOVF) { | 5712 | if (status & RxFOVF) { |
5710 | rtl8169_schedule_work(dev, rtl8169_reset_task); | 5713 | rtl8169_schedule_work(dev); |
5711 | dev->stats.rx_fifo_errors++; | 5714 | dev->stats.rx_fifo_errors++; |
5712 | } | 5715 | } |
5713 | rtl8169_mark_to_asic(desc, rx_buf_sz); | 5716 | rtl8169_mark_to_asic(desc, rx_buf_sz); |
@@ -5840,6 +5843,14 @@ done: | |||
5840 | return IRQ_RETVAL(handled); | 5843 | return IRQ_RETVAL(handled); |
5841 | } | 5844 | } |
5842 | 5845 | ||
5846 | static void rtl_task(struct work_struct *work) | ||
5847 | { | ||
5848 | struct rtl8169_private *tp = | ||
5849 | container_of(work, struct rtl8169_private, wk.work); | ||
5850 | |||
5851 | rtl_reset_work(tp); | ||
5852 | } | ||
5853 | |||
5843 | static int rtl8169_poll(struct napi_struct *napi, int budget) | 5854 | static int rtl8169_poll(struct napi_struct *napi, int budget) |
5844 | { | 5855 | { |
5845 | struct rtl8169_private *tp = container_of(napi, struct rtl8169_private, napi); | 5856 | struct rtl8169_private *tp = container_of(napi, struct rtl8169_private, napi); |
@@ -6046,7 +6057,7 @@ static void __rtl8169_resume(struct net_device *dev) | |||
6046 | 6057 | ||
6047 | rtl_pll_power_up(tp); | 6058 | rtl_pll_power_up(tp); |
6048 | 6059 | ||
6049 | rtl8169_schedule_work(dev, rtl8169_reset_task); | 6060 | rtl8169_schedule_work(dev); |
6050 | } | 6061 | } |
6051 | 6062 | ||
6052 | static int rtl8169_resume(struct device *device) | 6063 | static int rtl8169_resume(struct device *device) |