diff options
-rw-r--r-- | drivers/pci/pci.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9a5871f530a7..e8b3627e5474 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -3140,12 +3140,10 @@ static int pcie_flr(struct pci_dev *dev, int probe) | |||
3140 | return 0; | 3140 | return 0; |
3141 | 3141 | ||
3142 | if (!pci_wait_for_pending_transaction(dev)) | 3142 | if (!pci_wait_for_pending_transaction(dev)) |
3143 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); | 3143 | dev_err(&dev->dev, "timed out waiting for pending transaction; performing function level reset anyway\n"); |
3144 | 3144 | ||
3145 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); | 3145 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); |
3146 | |||
3147 | msleep(100); | 3146 | msleep(100); |
3148 | |||
3149 | return 0; | 3147 | return 0; |
3150 | } | 3148 | } |
3151 | 3149 | ||
@@ -3170,16 +3168,12 @@ static int pci_af_flr(struct pci_dev *dev, int probe) | |||
3170 | * is used, so we use the conrol offset rather than status and shift | 3168 | * is used, so we use the conrol offset rather than status and shift |
3171 | * the test bit to match. | 3169 | * the test bit to match. |
3172 | */ | 3170 | */ |
3173 | if (pci_wait_for_pending(dev, pos + PCI_AF_CTRL, | 3171 | if (!pci_wait_for_pending(dev, pos + PCI_AF_CTRL, |
3174 | PCI_AF_STATUS_TP << 8)) | 3172 | PCI_AF_STATUS_TP << 8)) |
3175 | goto clear; | 3173 | dev_err(&dev->dev, "timed out waiting for pending transaction; performing AF function level reset anyway\n"); |
3176 | 3174 | ||
3177 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); | ||
3178 | |||
3179 | clear: | ||
3180 | pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); | 3175 | pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); |
3181 | msleep(100); | 3176 | msleep(100); |
3182 | |||
3183 | return 0; | 3177 | return 0; |
3184 | } | 3178 | } |
3185 | 3179 | ||