Hello,
This series adds fixes for the PCI Keystone driver.
The v1 of this series was posted on the 24th of March 2021:
https://lore.kernel.org/r/[email protected]/
There are no changes since v1 except for rebasing the series on the
latest linux-next.
There were no open comments on the v1 series so it appears to me that
the series got missed when merging patches to the PCI tree. I am
reposting the series after rebasing it on linux-next tagged next-20240523.
I don't have the device corresponding to the older "ti,keystone-pcie"
compatible so I wasn't able to test this series (specifically patch 2
of this series). I have only compile-tested this series and logically
verified it for correctness to the best of my knowledge.
Regards,
Siddharth.
Kishon Vijay Abraham I (2):
PCI: keystone: Set mode as RootComplex for "ti,keystone-pcie"
compatible
PCI: keystone: Add link up check in ks_child_pcie_ops.map_bus()
drivers/pci/controller/dwc/pci-keystone.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--
2.40.1
From: Kishon Vijay Abraham I <[email protected]>
K2G forwards the error triggered by a link-down state (e.g., no connected
endpoint device) on the system bus for PCI configuration transactions;
these errors are reported as an SError at system level, which is fatal and
hangs the system. So fix it similar to how it was done in designware core
driver commit 15b23906347c ("PCI: dwc: Add link up check in
dw_child_pcie_ops.map_bus()")
Fixes: 10a797c6e54a ("PCI: dwc: keystone: Use pci_ops for config space accessors")
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Siddharth Vadapalli <[email protected]>
---
drivers/pci/controller/dwc/pci-keystone.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
index 3184546ba3b6..ca476fa584e7 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -430,6 +430,17 @@ static void __iomem *ks_pcie_other_map_bus(struct pci_bus *bus,
struct keystone_pcie *ks_pcie = to_keystone_pcie(pci);
u32 reg;
+ /*
+ * Checking whether the link is up here is a last line of defense
+ * against platforms that forward errors on the system bus as
+ * SError upon PCI configuration transactions issued when the link
+ * is down. This check is racy by definition and does not stop
+ * the system from triggering an SError if the link goes down
+ * after this check is performed.
+ */
+ if (!dw_pcie_link_up(pci))
+ return NULL;
+
reg = CFG_BUS(bus->number) | CFG_DEVICE(PCI_SLOT(devfn)) |
CFG_FUNC(PCI_FUNC(devfn));
if (!pci_is_root_bus(bus->parent))
--
2.40.1