From: "Pali Rohár" <pali@kernel.org>
To: "Stefan Roese" <sr@denx.de>, "Marek Behún" <marek.behun@nic.cz>
Cc: u-boot@lists.denx.de
Subject: [PATCH u-boot-marvell 2/3] arm: a37xx: pci: Register controller also when no PCIe card is connected
Date: Tue, 15 Feb 2022 11:23:36 +0100 [thread overview]
Message-ID: <20220215102337.18426-2-pali@kernel.org> (raw)
In-Reply-To: <20220215102337.18426-1-pali@kernel.org>
Allow access to config space of PCIe Root Port (which is always present on
the root bus) even when PCIe link is down or no card is connected.
Signed-off-by: Pali Rohár <pali@kernel.org>
---
drivers/pci/pci-aardvark.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index ccaeecaca8e3..c795ef10b884 100644
--- a/drivers/pci/pci-aardvark.c
+++ b/drivers/pci/pci-aardvark.c
@@ -645,11 +645,8 @@ retry:
* @pcie: The PCI device to access
*
* Wait up to 1 second for link training to be accomplished.
- *
- * Return 1 (true) if link training ends up with link up success.
- * Return 0 (false) if link training ends up with link up failure.
*/
-static int pcie_advk_wait_for_link(struct pcie_advk *pcie)
+static void pcie_advk_wait_for_link(struct pcie_advk *pcie)
{
int retries;
@@ -657,15 +654,13 @@ static int pcie_advk_wait_for_link(struct pcie_advk *pcie)
for (retries = 0; retries < LINK_MAX_RETRIES; retries++) {
if (pcie_advk_link_up(pcie)) {
printf("PCIe: Link up\n");
- return 0;
+ return;
}
udelay(LINK_WAIT_TIMEOUT);
}
printf("PCIe: Link down\n");
-
- return -ETIMEDOUT;
}
/*
@@ -898,8 +893,7 @@ static int pcie_advk_setup_hw(struct pcie_advk *pcie)
return -EINVAL;
/* Wait for PCIe link up */
- if (pcie_advk_wait_for_link(pcie))
- return -ENXIO;
+ pcie_advk_wait_for_link(pcie);
return 0;
}
--
2.20.1
next prev parent reply other threads:[~2022-02-15 10:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 10:23 [PATCH u-boot-marvell 1/3] arm: a37xx: pci: Do not try to access other buses when link is down Pali Rohár
2022-02-15 10:23 ` Pali Rohár [this message]
2022-02-16 8:58 ` [PATCH u-boot-marvell 2/3] arm: a37xx: pci: Register controller also when no PCIe card is connected Stefan Roese
2022-02-15 10:23 ` [PATCH u-boot-marvell 3/3] arm: a37xx: pci: Update comment about Command/Direct mode Pali Rohár
2022-02-16 8:59 ` Stefan Roese
2022-02-16 8:57 ` [PATCH u-boot-marvell 1/3] arm: a37xx: pci: Do not try to access other buses when link is down Stefan Roese
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=20220215102337.18426-2-pali@kernel.org \
--to=pali@kernel.org \
--cc=marek.behun@nic.cz \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
/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