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

PCI: Make FLR and AF FLR reset warning messages different

We have same warning message for FLR and AF FLR and users can't know which
type of resets the PCI device is taking when there are pending
transactions.  Print different messages for FLR and AF FLR cases.

[bhelgaas: make code structure parallel, add "anyway" to suggest risk]
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 754834b9
...@@ -3140,12 +3140,10 @@ static int pcie_flr(struct pci_dev *dev, int probe) ...@@ -3140,12 +3140,10 @@ static int pcie_flr(struct pci_dev *dev, int probe)
return 0; return 0;
if (!pci_wait_for_pending_transaction(dev)) if (!pci_wait_for_pending_transaction(dev))
dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); dev_err(&dev->dev, "timed out waiting for pending transaction; performing function level reset anyway\n");
pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
msleep(100); msleep(100);
return 0; return 0;
} }
...@@ -3170,16 +3168,12 @@ static int pci_af_flr(struct pci_dev *dev, int probe) ...@@ -3170,16 +3168,12 @@ static int pci_af_flr(struct pci_dev *dev, int probe)
* is used, so we use the conrol offset rather than status and shift * is used, so we use the conrol offset rather than status and shift
* the test bit to match. * the test bit to match.
*/ */
if (pci_wait_for_pending(dev, pos + PCI_AF_CTRL, if (!pci_wait_for_pending(dev, pos + PCI_AF_CTRL,
PCI_AF_STATUS_TP << 8)) PCI_AF_STATUS_TP << 8))
goto clear; dev_err(&dev->dev, "timed out waiting for pending transaction; performing AF function level reset anyway\n");
dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n");
clear:
pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
msleep(100); msleep(100);
return 0; return 0;
} }
......
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