Skip to content

Commit c1787c3

Browse files
committed
Merge branch 'pci/controller/keystone'
- Set the 'ti,keystone-pcie' mode so v3.65a devices work in Root Complex mode (Kishon Vijay Abraham I) - Try to avoid unrecoverable SError for attempts to issue config transactions when the link is down; this is racy but the best we can do (Kishon Vijay Abraham I) * pci/controller/keystone: PCI: keystone: Add link up check to ks_pcie_other_map_bus() PCI: keystone: Set mode as Root Complex for "ti,keystone-pcie" compatible
2 parents 5c8bd7f + 9e9ec8d commit c1787c3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,17 @@ static void __iomem *ks_pcie_other_map_bus(struct pci_bus *bus,
455455
struct keystone_pcie *ks_pcie = to_keystone_pcie(pci);
456456
u32 reg;
457457

458+
/*
459+
* Checking whether the link is up here is a last line of defense
460+
* against platforms that forward errors on the system bus as
461+
* SError upon PCI configuration transactions issued when the link
462+
* is down. This check is racy by definition and does not stop
463+
* the system from triggering an SError if the link goes down
464+
* after this check is performed.
465+
*/
466+
if (!dw_pcie_link_up(pci))
467+
return NULL;
468+
458469
reg = CFG_BUS(bus->number) | CFG_DEVICE(PCI_SLOT(devfn)) |
459470
CFG_FUNC(PCI_FUNC(devfn));
460471
if (!pci_is_root_bus(bus->parent))
@@ -1093,6 +1104,7 @@ static int ks_pcie_am654_set_mode(struct device *dev,
10931104

10941105
static const struct ks_pcie_of_data ks_pcie_rc_of_data = {
10951106
.host_ops = &ks_pcie_host_ops,
1107+
.mode = DW_PCIE_RC_TYPE,
10961108
.version = DW_PCIE_VER_365A,
10971109
};
10981110

0 commit comments

Comments
 (0)