]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
e1000: Prevent reset task killing itself.
authorTushar Dave <tushar.n.dave@intel.com>
Thu, 17 May 2012 01:04:50 +0000 (01:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 May 2012 17:46:21 +0000 (10:46 -0700)
commit 8ce6909f77ba1b7bcdea65cc2388fd1742b6d669 upstream.

Killing reset task while adapter is resetting causes deadlock.
Only kill reset task if adapter is not resetting.
Ref bug #43132 on bugzilla.kernel.org

Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/e1000/e1000_main.c

index b444f2114ff1e971ca676284175b4c4c5e0789e8..b72d97604258359ca7284a27777592f249d9d56d 100644 (file)
@@ -492,7 +492,11 @@ out:
 static void e1000_down_and_stop(struct e1000_adapter *adapter)
 {
        set_bit(__E1000_DOWN, &adapter->flags);
-       cancel_work_sync(&adapter->reset_task);
+
+       /* Only kill reset task if adapter is not resetting */
+       if (!test_bit(__E1000_RESETTING, &adapter->flags))
+               cancel_work_sync(&adapter->reset_task);
+
        cancel_delayed_work_sync(&adapter->watchdog_task);
        cancel_delayed_work_sync(&adapter->phy_info_task);
        cancel_delayed_work_sync(&adapter->fifo_stall_task);