]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Merge tag 'pci-v3.12-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[~andy/linux] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_main.c
index 1627a4e09c32fd3980f7db8bbfc686621391b393..815f2dea6337738e19b8f1bd313570d645996656 100644 (file)
@@ -9960,8 +9960,6 @@ static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi)
 
 static int bnx2x_do_flr(struct bnx2x *bp)
 {
-       int i;
-       u16 status;
        struct pci_dev *dev = bp->pdev;
 
        if (CHIP_IS_E1x(bp)) {
@@ -9976,20 +9974,8 @@ static int bnx2x_do_flr(struct bnx2x *bp)
                return -EINVAL;
        }
 
-       /* Wait for Transaction Pending bit clean */
-       for (i = 0; i < 4; i++) {
-               if (i)
-                       msleep((1 << (i - 1)) * 100);
-
-               pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &status);
-               if (!(status & PCI_EXP_DEVSTA_TRPND))
-                       goto clear;
-       }
-
-       dev_err(&dev->dev,
-               "transaction is not cleared; proceeding with reset anyway\n");
-
-clear:
+       if (!pci_wait_for_pending_transaction(dev))
+               dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n");
 
        BNX2X_DEV_INFO("Initiating FLR\n");
        bnx2x_fw_command(bp, DRV_MSG_CODE_INITIATE_FLR, 0);