Commit 5b17dbab authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

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
parents 06f3506e 70e38025
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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);