From: Bjorn Helgaas <helgaas@kernel.org>
To: Ley Foon Tan <lftan@altera.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
Ley Foon Tan <lftan.linux@gmail.com>
Subject: Re: [PATCH] PCI: altera: Retrain link in rootport mode only
Date: Thu, 18 Aug 2016 15:18:43 -0500 [thread overview]
Message-ID: <20160818201843.GI27353@localhost> (raw)
In-Reply-To: <1471250179-24198-1-git-send-email-lftan@altera.com>
On Mon, Aug 15, 2016 at 04:36:19PM +0800, Ley Foon Tan wrote:
> Altera PCIe IP can be configured as rootport or device and they might have
> same vendor ID. It will cause the system hang issue if Altera PCIe is in
> endpoint mode and work with other PCIe rootport that from other vendors.
> So, add the rootport mode checking in link retrain fixup function.
>
> Signed-off-by: Ley Foon Tan <lftan@altera.com>
> ---
> drivers/pci/host/pcie-altera.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
> index 58eef99..6477738 100644
> --- a/drivers/pci/host/pcie-altera.c
> +++ b/drivers/pci/host/pcie-altera.c
> @@ -139,6 +139,9 @@ static void altera_pcie_retrain(struct pci_dev *dev)
> u16 linkcap, linkstat;
> struct altera_pcie *pcie = dev->bus->sysdata;
>
> + if (!pci_is_root_bus(dev->bus))
> + return;
It seems like it would be more direct to check for
"pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT"?
> if (!altera_pcie_link_is_up(pcie))
> return;
>
> --
> 1.8.2.1
>
next prev parent reply other threads:[~2016-08-19 1:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 8:36 [PATCH] PCI: altera: Retrain link in rootport mode only Ley Foon Tan
2016-08-18 20:18 ` Bjorn Helgaas [this message]
2016-08-19 7:54 ` Ley Foon Tan
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=20160818201843.GI27353@localhost \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=lftan.linux@gmail.com \
--cc=lftan@altera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/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).