e1000e: fix double initialization in blink path
authorHolger Eitzenberger <holger@eitzenberger.org>
Wed, 17 Nov 2010 15:43:52 +0000 (15:43 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 11 Dec 2010 06:13:01 +0000 (22:13 -0800)
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>
drivers/net/e1000e/e1000.h
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/netdev.c

index fdc67fead4ea529e3574f38252273deaec456bca..3d9366ffd16edffbea9d9e6cdd0f97c9be790f66 100644 (file)
@@ -482,6 +482,7 @@ extern const char e1000e_driver_version[];
 
 extern void e1000e_check_options(struct e1000_adapter *adapter);
 extern void e1000e_set_ethtool_ops(struct net_device *netdev);
+extern void e1000e_led_blink_task(struct work_struct *work);
 
 extern int e1000e_up(struct e1000_adapter *adapter);
 extern void e1000e_down(struct e1000_adapter *adapter);
index 3612900b3bfe4ff091952bf7c861862c04d3dd9a..5c6bc6ac069c503c60ade13181097dc7bfc7de42 100644 (file)
@@ -1846,7 +1846,7 @@ static int e1000_set_wol(struct net_device *netdev,
 /* bit defines for adapter->led_status */
 #define E1000_LED_ON           0
 
-static void e1000e_led_blink_task(struct work_struct *work)
+void e1000e_led_blink_task(struct work_struct *work)
 {
        struct e1000_adapter *adapter = container_of(work,
                                        struct e1000_adapter, led_blink_task);
@@ -1878,7 +1878,6 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)
            (hw->mac.type == e1000_pch2lan) ||
            (hw->mac.type == e1000_82583) ||
            (hw->mac.type == e1000_82574)) {
-               INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
                if (!adapter->blink_timer.function) {
                        init_timer(&adapter->blink_timer);
                        adapter->blink_timer.function =
index 0adcb79e63863f567141f883ed79f3118a0ee630..f8efbbbfddfbb99018a469f1b8a229c72e352645 100644 (file)
@@ -5903,6 +5903,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
        INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
        INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);
+       INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
 
        /* Initialize link parameters. User can change them with ethtool */
        adapter->hw.mac.autoneg = 1;