diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2010-11-17 10:43:52 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2010-12-11 01:13:01 -0500 |
commit | 9633e63bb1d82c02950983d5d3317e6656b11c8e (patch) | |
tree | fb13f79801a120a73a2e72c78c60df3cdc30ec44 /drivers/net | |
parent | 9fe93afdd07aba52a018eb52784124579a80470e (diff) |
e1000e: fix double initialization in blink path
The kernel goes BUG() at the time 'ethtool -p eth0 3' comes
back, which is due to adapter->led_blink_task initialized
several times. At the time it is still running this results
in a corrupted task_list of the associated workqueue.
The fix is to move the workqueue initialization to the
probe function instead.
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000e/e1000.h | 1 | ||||
-rw-r--r-- | drivers/net/e1000e/ethtool.c | 3 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index fdc67fead4ea..3d9366ffd16e 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -482,6 +482,7 @@ extern const char e1000e_driver_version[]; | |||
482 | 482 | ||
483 | extern void e1000e_check_options(struct e1000_adapter *adapter); | 483 | extern void e1000e_check_options(struct e1000_adapter *adapter); |
484 | extern void e1000e_set_ethtool_ops(struct net_device *netdev); | 484 | extern void e1000e_set_ethtool_ops(struct net_device *netdev); |
485 | extern void e1000e_led_blink_task(struct work_struct *work); | ||
485 | 486 | ||
486 | extern int e1000e_up(struct e1000_adapter *adapter); | 487 | extern int e1000e_up(struct e1000_adapter *adapter); |
487 | extern void e1000e_down(struct e1000_adapter *adapter); | 488 | extern void e1000e_down(struct e1000_adapter *adapter); |
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 3612900b3bfe..5c6bc6ac069c 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -1846,7 +1846,7 @@ static int e1000_set_wol(struct net_device *netdev, | |||
1846 | /* bit defines for adapter->led_status */ | 1846 | /* bit defines for adapter->led_status */ |
1847 | #define E1000_LED_ON 0 | 1847 | #define E1000_LED_ON 0 |
1848 | 1848 | ||
1849 | static void e1000e_led_blink_task(struct work_struct *work) | 1849 | void e1000e_led_blink_task(struct work_struct *work) |
1850 | { | 1850 | { |
1851 | struct e1000_adapter *adapter = container_of(work, | 1851 | struct e1000_adapter *adapter = container_of(work, |
1852 | struct e1000_adapter, led_blink_task); | 1852 | struct e1000_adapter, led_blink_task); |
@@ -1878,7 +1878,6 @@ static int e1000_phys_id(struct net_device *netdev, u32 data) | |||
1878 | (hw->mac.type == e1000_pch2lan) || | 1878 | (hw->mac.type == e1000_pch2lan) || |
1879 | (hw->mac.type == e1000_82583) || | 1879 | (hw->mac.type == e1000_82583) || |
1880 | (hw->mac.type == e1000_82574)) { | 1880 | (hw->mac.type == e1000_82574)) { |
1881 | INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task); | ||
1882 | if (!adapter->blink_timer.function) { | 1881 | if (!adapter->blink_timer.function) { |
1883 | init_timer(&adapter->blink_timer); | 1882 | init_timer(&adapter->blink_timer); |
1884 | adapter->blink_timer.function = | 1883 | adapter->blink_timer.function = |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 0adcb79e6386..f8efbbbfddfb 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -5903,6 +5903,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
5903 | INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); | 5903 | INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); |
5904 | INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); | 5904 | INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); |
5905 | INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); | 5905 | INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); |
5906 | INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task); | ||
5906 | 5907 | ||
5907 | /* Initialize link parameters. User can change them with ethtool */ | 5908 | /* Initialize link parameters. User can change them with ethtool */ |
5908 | adapter->hw.mac.autoneg = 1; | 5909 | adapter->hw.mac.autoneg = 1; |