public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: "Pali Rohár" <pali@kernel.org>
Cc: "Marek Behún" <marek.behun@nic.cz>, u-boot@lists.denx.de
Subject: Re: [PATCH 5/8] pci: pci_mvebu: Fix place of link up detection
Date: Tue, 2 Nov 2021 11:50:03 +0100	[thread overview]
Message-ID: <dc148ac7-e26d-22d3-3926-53d30e44a5cb@denx.de> (raw)
In-Reply-To: <20211022142215.26484-6-pali@kernel.org>

On 22.10.21 16:22, Pali Rohár wrote:
> PCI Bridge is always accessible also when link is down. So move detection
> of link up from mvebu_pcie_of_to_plat() function to mvebu_pcie_valid_addr()
> function which is used when accessing PCI config space.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Reviewed-by: Marek Behún <marek.behun@nic.cz>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   drivers/pci/pci_mvebu.c | 14 ++++----------
>   1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c
> index 4b8e56f22dfa..40b8a57bbe1e 100644
> --- a/drivers/pci/pci_mvebu.c
> +++ b/drivers/pci/pci_mvebu.c
> @@ -138,6 +138,10 @@ static bool mvebu_pcie_valid_addr(struct mvebu_pcie *pcie,
>   	if (busno == pcie->first_busno && (dev != 0 || func != 0))
>   		return false;
>   
> +	/* Access to other buses is possible when link is up */
> +	if (busno != pcie->first_busno && !mvebu_pcie_link_up(pcie))
> +		return false;
> +
>   	/* On secondary bus can be only one PCIe device */
>   	if (busno == pcie->sec_busno && dev != 0)
>   		return false;
> @@ -369,9 +373,6 @@ static int mvebu_pcie_probe(struct udevice *dev)
>   	struct pci_controller *hose = dev_get_uclass_priv(ctlr);
>   	u32 reg;
>   
> -	debug("%s: PCIe %d.%d - up, base %08x\n", __func__,
> -	      pcie->port, pcie->lane, (u32)pcie->base);
> -
>   	/*
>   	 * Change Class Code of PCI Bridge device to PCI Bridge (0x600400)
>   	 * because default value is Memory controller (0x508000) which
> @@ -603,13 +604,6 @@ static int mvebu_pcie_of_to_plat(struct udevice *dev)
>   	if (ret < 0)
>   		goto err;
>   
> -	/* Check link and skip ports that have no link */
> -	if (!mvebu_pcie_link_up(pcie)) {
> -		debug("%s: %s - down\n", __func__, pcie->name);
> -		ret = -ENODEV;
> -		goto err;
> -	}
> -
>   	return 0;
>   
>   err:
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

  reply	other threads:[~2021-11-02 10:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 14:22 [PATCH 0/8] pci: pci_mvebu: Fix access to config space and PCIe Root Port Pali Rohár
2021-10-22 14:22 ` [PATCH 1/8] pci: pci_mvebu: Fix write_config() with PCI_SIZE_8 or PCI_SIZE_16 Pali Rohár
2021-11-02 10:44   ` Stefan Roese
2021-10-22 14:22 ` [PATCH 2/8] pci: pci_mvebu: Fix read_config() " Pali Rohár
2021-11-02 10:45   ` Stefan Roese
2021-10-22 14:22 ` [PATCH 3/8] pci: pci_mvebu: Properly configure and use PCI Bridge (PCIe Root Port) Pali Rohár
2021-11-02 10:47   ` Stefan Roese
2021-10-22 14:22 ` [PATCH 4/8] pci: pci_mvebu: Remove unused functions Pali Rohár
2021-11-02 10:47   ` Stefan Roese
2021-10-22 14:22 ` [PATCH 5/8] pci: pci_mvebu: Fix place of link up detection Pali Rohár
2021-11-02 10:50   ` Stefan Roese [this message]
2021-10-22 14:22 ` [PATCH 6/8] pci: pci_mvebu: Do not automatically enable bus mastering on PCI Bridge Pali Rohár
2021-11-02 10:50   ` Stefan Roese
2021-10-22 14:22 ` [PATCH 7/8] pci: pci_mvebu: Setup PCI controller to Root Complex mode Pali Rohár
2021-11-02 10:50   ` Stefan Roese
2021-10-22 14:22 ` [PATCH 8/8] pci: pci_mvebu: Fix comment about driver class name Pali Rohár
2021-11-02 10:50   ` Stefan Roese
2021-11-03  7:46 ` [PATCH 0/8] pci: pci_mvebu: Fix access to config space and PCIe Root Port 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=dc148ac7-e26d-22d3-3926-53d30e44a5cb@denx.de \
    --to=sr@denx.de \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --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