From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: <lpieralisi@kernel.org>, <robh@kernel.org>, <kw@linux.com>,
<bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <r-gunasekaran@ti.com>,
<srk@ti.com>, <s-vadapalli@ti.com>
Subject: [PATCH] PCI: keystone: Don't enable BAR0 if link is not detected
Date: Wed, 11 Oct 2023 18:04:51 +0530 [thread overview]
Message-ID: <20231011123451.34827-1-s-vadapalli@ti.com> (raw)
Since the function dw_pcie_host_init() ignores the absence of link under
the assumption that link can come up later, it is possible that the
pci_host_probe(bridge) function is invoked even when no endpoint device
is connected. In such a situation, the ks_pcie_v3_65_add_bus() function
configures BAR0 when the link is not up, resulting in Completion Timeouts
during the MSI configuration performed later by the PCI Express Port driver
to setup AER, PME and other services. Thus, leave BAR0 disabled if link is
not yet detected when the ks_pcie_v3_65_add_bus() function is invoked.
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
Hello,
This patch is based on linux-next tagged next-20231011.
Regards,
Siddharth.
drivers/pci/controller/dwc/pci-keystone.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
index 49aea6ce3e87..ac2ad112d616 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -459,7 +459,8 @@ static int ks_pcie_v3_65_add_bus(struct pci_bus *bus)
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
struct keystone_pcie *ks_pcie = to_keystone_pcie(pci);
- if (!pci_is_root_bus(bus))
+ /* Don't enable BAR0 if link is not yet up at this point */
+ if (!pci_is_root_bus(bus) || !dw_pcie_link_up(pci))
return 0;
/* Configure and set up BAR0 */
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-10-11 12:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 12:34 Siddharth Vadapalli [this message]
2023-10-11 13:46 ` [PATCH] PCI: keystone: Don't enable BAR0 if link is not detected Bjorn Helgaas
2023-10-12 4:45 ` Siddharth Vadapalli
2023-10-12 16:43 ` Bjorn Helgaas
2023-10-13 5:03 ` Siddharth Vadapalli
2023-10-13 5:06 ` Siddharth Vadapalli
2023-10-13 18:49 ` Bjorn Helgaas
2023-10-14 5:52 ` Siddharth Vadapalli
2023-10-16 21:29 ` Serge Semin
2023-10-17 4:14 ` Siddharth Vadapalli
2023-10-18 10:42 ` Serge Semin
2023-10-18 10:49 ` Siddharth Vadapalli
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231011123451.34827-1-s-vadapalli@ti.com \
--to=s-vadapalli@ti.com \
--cc=bhelgaas@google.com \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=r-gunasekaran@ti.com \
--cc=robh@kernel.org \
--cc=srk@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox