Merge branch 'remotes/lorenzo/pci/aardvark'

- Indicate error in 'val' when config read fails (Pali Rohár)

- Don't touch PCIe registers if no card connected (Pali Rohár)

* remotes/lorenzo/pci/aardvark:
  PCI: aardvark: Don't touch PCIe registers if no card connected
  PCI: aardvark: Indicate error in 'val' when config read fails
This commit is contained in:
Bjorn Helgaas 2020-08-05 18:24:18 -05:00
commit 5b17dbab26

View File

@ -644,6 +644,13 @@ static bool advk_pcie_valid_device(struct advk_pcie *pcie, struct pci_bus *bus,
if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0)
return false;
/*
* If the link goes down after we check for link-up, nothing bad
* happens but the config access times out.
*/
if (bus->number != pcie->root_bus_nr && !advk_pcie_link_up(pcie))
return false;
return true;
}
@ -688,8 +695,10 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
advk_writel(pcie, 1, PIO_START);
ret = advk_pcie_wait_pio(pcie);
if (ret < 0)
if (ret < 0) {
*val = 0xffffffff;
return PCIBIOS_SET_FAILED;
}
advk_pcie_check_pio_status(pcie);