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:
commit
5b17dbab26
@ -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)
|
if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0)
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -688,8 +695,10 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
|
|||||||
advk_writel(pcie, 1, PIO_START);
|
advk_writel(pcie, 1, PIO_START);
|
||||||
|
|
||||||
ret = advk_pcie_wait_pio(pcie);
|
ret = advk_pcie_wait_pio(pcie);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
*val = 0xffffffff;
|
||||||
return PCIBIOS_SET_FAILED;
|
return PCIBIOS_SET_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
advk_pcie_check_pio_status(pcie);
|
advk_pcie_check_pio_status(pcie);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user