]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tg3: Clear RECOVERY_PENDING with reset_task_cancel
authorMatt Carlson <mcarlson@broadcom.com>
Wed, 22 Feb 2012 12:35:20 +0000 (12:35 +0000)
committerJoe Jin <joe.jin@oracle.com>
Tue, 28 Aug 2012 07:23:05 +0000 (15:23 +0800)
If an error happens in the tx completion thread, tg3_reset_task will be
scheduled and TX_RECOVERY_PENDING will be set.  The TX_RECOVERY_PENDING
flag causes tg3_poll[_msix] to return early before doing much of its
work.  Tg3_reset_task() gets canceled when the configuration of the
device is changing, which always results in a chip reset.  When this
happens, the TX_RECOVERY_PENDING flag may be left set, which would
unnecessarily hinder tg3_poll from doing work.  This patch fixes the
problem.

(cherry picked from commit c71013597d49c7ca8bb5049f0c7873df2643fad5)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c

index 5670e37296cc6af3ddc0597436964696ba4e6666..8f1bfdc10f46cbb818a880214275a67323cb87f8 100644 (file)
@@ -6159,6 +6159,7 @@ static inline void tg3_reset_task_cancel(struct tg3 *tp)
 {
        cancel_work_sync(&tp->reset_task);
        tg3_flag_clear(tp, RESET_TASK_PENDING);
+       tg3_flag_clear(tp, TX_RECOVERY_PENDING);
 }
 
 static int tg3_poll_msix(struct napi_struct *napi, int budget)
@@ -15943,7 +15944,6 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
 
        /* Want to make sure that the reset task doesn't run */
        tg3_reset_task_cancel(tp);
-       tg3_flag_clear(tp, TX_RECOVERY_PENDING);
 
        netif_device_detach(netdev);