archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <>
To: Kishon Vijay Abraham I <>,
	Lorenzo Pieralisi <>,
	Rob Herring <>,
	Bjorn Helgaas <>
Cc: <>,
	<>, Lokesh Vutla <>
Subject: [PATCH 2/2] PCI: keystone: Add link up check in ks_child_pcie_ops.map_bus()
Date: Wed, 24 Mar 2021 17:49:01 +0530	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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

Fixes: 10a797c6e54a ("PCI: dwc: keystone: Use pci_ops for config space accessors")
Signed-off-by: Kishon Vijay Abraham I <>
Cc: <> # v5.10
 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 7171ea70da49..4de8c8e5e3f2 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -432,6 +432,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)) |
 	if (!pci_is_root_bus(bus->parent))

      parent reply	other threads:[~2021-03-24 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 12:18 [PATCH 0/2] PCI: Fixes in pci-keystone driver Kishon Vijay Abraham I
2021-03-24 12:19 ` [PATCH 1/2] PCI: keystone: Set mode as RootComplex for "ti,keystone-pcie" compatible Kishon Vijay Abraham I
2021-03-24 12:19 ` Kishon Vijay Abraham I [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 2/2] PCI: keystone: Add link up check in ks_child_pcie_ops.map_bus()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).