Commit d0b4cc4e authored by Gavin Shan's avatar Gavin Shan Committed by Bjorn Helgaas

PCI: Wrong register used to check pending traffic

The incorrect register offset is passed to pci_wait_for_pending(), which is
caused by commit 157e876f ("PCI: Add pci_wait_for_pending() (refactor
pci_wait_for_pending_transaction())").

Fixes: 157e876f ("PCI: Add pci_wait_for_pending() (refactor pci_wait_for_pending_transaction())
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarAlex Williamson <alex.williamson@gmail.com>
CC: stable@vger.kernel.org	# v3.14+
parent 93fa9d32
...@@ -3067,7 +3067,8 @@ int pci_wait_for_pending_transaction(struct pci_dev *dev) ...@@ -3067,7 +3067,8 @@ int pci_wait_for_pending_transaction(struct pci_dev *dev)
if (!pci_is_pcie(dev)) if (!pci_is_pcie(dev))
return 1; return 1;
return pci_wait_for_pending(dev, PCI_EXP_DEVSTA, PCI_EXP_DEVSTA_TRPND); return pci_wait_for_pending(dev, pci_pcie_cap(dev) + PCI_EXP_DEVSTA,
PCI_EXP_DEVSTA_TRPND);
} }
EXPORT_SYMBOL(pci_wait_for_pending_transaction); EXPORT_SYMBOL(pci_wait_for_pending_transaction);
...@@ -3109,7 +3110,7 @@ static int pci_af_flr(struct pci_dev *dev, int probe) ...@@ -3109,7 +3110,7 @@ static int pci_af_flr(struct pci_dev *dev, int probe)
return 0; return 0;
/* Wait for Transaction Pending bit clean */ /* Wait for Transaction Pending bit clean */
if (pci_wait_for_pending(dev, PCI_AF_STATUS, PCI_AF_STATUS_TP)) if (pci_wait_for_pending(dev, pos + PCI_AF_STATUS, PCI_AF_STATUS_TP))
goto clear; goto clear;
dev_err(&dev->dev, "transaction is not cleared; " dev_err(&dev->dev, "transaction is not cleared; "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment