linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Yijing Wang <wangyijing@huawei.com>
Cc: linux-pci@vger.kernel.org, mjg59@coreos.com, rwhite@pobox.com,
	alex.williamson@redhat.com
Subject: Re: [PATCH v4 3/3] PCI: Use pdev->has_secondary_link to identify pcie link
Date: Tue, 26 May 2015 18:58:17 -0500	[thread overview]
Message-ID: <20150526235817.GP32152@google.com> (raw)
In-Reply-To: <1432191904-16451-3-git-send-email-wangyijing@huawei.com>

On Thu, May 21, 2015 at 03:05:04PM +0800, Yijing Wang wrote:
> We assumed pcie root port and downstream port always have
> pcie link, but in some unusual pcie topology platform like
> ATCA, it may has the following pcie tree:
> 
> root port ---- downstream port -----upstream port
>                                    |
>                                    |downstream port
> Now we introduce a flag pdev->has_secondary_link to tag
> a device whether has pcie link, use it instead.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

Applied to pci/aspm for v4.2, thanks!

> ---
>  drivers/pci/pcie/aer/aerdrv_core.c |    3 +--
>  drivers/pci/probe.c                |    2 +-
>  drivers/pci/vc.c                   |    3 +--
>  3 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
> index 5653ea9..9803e3d 100644
> --- a/drivers/pci/pcie/aer/aerdrv_core.c
> +++ b/drivers/pci/pcie/aer/aerdrv_core.c
> @@ -425,8 +425,7 @@ static pci_ers_result_t reset_link(struct pci_dev *dev)
>  
>  	if (driver && driver->reset_link) {
>  		status = driver->reset_link(udev);
> -	} else if (pci_pcie_type(udev) == PCI_EXP_TYPE_DOWNSTREAM ||
> -		pci_pcie_type(udev) == PCI_EXP_TYPE_ROOT_PORT) {
> +	} else if (udev->has_secondary_link) {
>  		status = default_reset_link(udev);
>  	} else {
>  		dev_printk(KERN_DEBUG, &dev->dev,
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 192c6b9..eba4928 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1645,7 +1645,7 @@ static int only_one_child(struct pci_bus *bus)
>  		return 0;
>  	if (pci_pcie_type(parent) == PCI_EXP_TYPE_ROOT_PORT)
>  		return 1;
> -	if (pci_pcie_type(parent) == PCI_EXP_TYPE_DOWNSTREAM &&
> +	if (parent->has_secondary_link &&
>  	    !pci_has_flag(PCI_SCAN_ALL_PCIE_DEVS))
>  		return 1;
>  	return 0;
> diff --git a/drivers/pci/vc.c b/drivers/pci/vc.c
> index 7e1304d..dfbab61 100644
> --- a/drivers/pci/vc.c
> +++ b/drivers/pci/vc.c
> @@ -108,8 +108,7 @@ static void pci_vc_enable(struct pci_dev *dev, int pos, int res)
>  	struct pci_dev *link = NULL;
>  
>  	/* Enable VCs from the downstream device */
> -	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT ||
> -	    pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM)
> +	if (!dev->has_secondary_link)
>  		return;
>  
>  	ctrl_pos = pos + PCI_VC_RES_CTRL + (res * PCI_CAP_VC_PER_VC_SIZEOF);
> -- 
> 1.7.1
> 

  reply	other threads:[~2015-05-26 23:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21  7:05 [PATCH v4 1/3] PCI: Add pdev->has_secondary_link to mark pcie link Yijing Wang
2015-05-21  7:05 ` [PATCH v4 2/3] PCI/ASPM: Fix NULL pointer when find parent pcie_link_state Yijing Wang
2015-05-22 19:42   ` Bjorn Helgaas
2015-05-25  1:26     ` Yijing Wang
2015-05-21  7:05 ` [PATCH v4 3/3] PCI: Use pdev->has_secondary_link to identify pcie link Yijing Wang
2015-05-26 23:58   ` Bjorn Helgaas [this message]
2015-05-26 23:57 ` [PATCH v4 1/3] PCI: Add pdev->has_secondary_link to mark " Bjorn Helgaas

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=20150526235817.GP32152@google.com \
    --to=bhelgaas@google.com \
    --cc=alex.williamson@redhat.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mjg59@coreos.com \
    --cc=rwhite@pobox.com \
    --cc=wangyijing@huawei.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;
as well as URLs for NNTP newsgroup(s).