All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Prarit Bhargava <prarit@redhat.com>
Cc: Don Dutile <ddutile@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	James Paradis <jparadis@redhat.com>,
	linux-pci@vger.kernel.org, mstowe@redhat.com,
	jbarnes@virtuousgeek.org
Subject: Re: [PATCH] pci: Workaround Stratus broken PCIE hierarchy
Date: Tue, 15 Nov 2011 13:15:36 -0700	[thread overview]
Message-ID: <20111115201536.GF4387@parisc-linux.org> (raw)
In-Reply-To: <4EC28B93.1060101@redhat.com>

On Tue, Nov 15, 2011 at 10:56:03AM -0500, Prarit Bhargava wrote:
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 04e74f4..fc88a9b 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1270,13 +1270,18 @@ static unsigned no_next_fn(struct pci_dev *dev, unsigned fn)
>  	return 0;
>  }
>  
> +int pcie_scan_all = 0; /* set via pci=pcie_scan_all */
>  static int only_one_child(struct pci_bus *bus)
>  {
>  	struct pci_dev *parent = bus->self;
> +	if (pcie_scan_all)
> +		return 0;
>  	if (!parent || !pci_is_pcie(parent))
>  		return 0;
> -	if (parent->pcie_type == PCI_EXP_TYPE_ROOT_PORT ||
> -	    parent->pcie_type == PCI_EXP_TYPE_DOWNSTREAM)
> +	if (parent->pcie_type == PCI_EXP_TYPE_ROOT_PORT)
> +		return 1;
> +	if (parent->pcie_type == PCI_EXP_TYPE_DOWNSTREAM &&
> +	    !is_broken_pcie_port())
>  		return 1;
>  	return 0;
>  }
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 7285145..ef4d0e7 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -3092,3 +3092,21 @@ int pci_dev_specific_reset(struct pci_dev *dev, int probe)
>  
>  	return -ENOTTY;
>  }
> +
> +static int _is_broken_pcie_port = -1;
> +int is_broken_pcie_port(void)
> +{
> +	if (_is_broken_pcie_port >= 0)
> +		return _is_broken_pcie_port;
> +	/*
> +	 * Stratus/NEC ftServer systems have a broken PCIE hierarchy in which
> +	 * one upstream and one downstream port are plugged into a downstream
> +	 * port.  Avoiding the downstream port check in only_one_child() results
> +	 * in a functional system.
> +	 */
> +	if (dmi_name_in_vendors("ftServer"))
> +		_is_broken_pcie_port = 1;
> +	else
> +		_is_broken_pcie_port = 0;
> +	return _is_broken_pcie_port;
> +}

This feels like belt-and-braces.  Why don't you just set pcie_scan_all
if the DMI string contains ftServer?

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  parent reply	other threads:[~2011-11-15 20:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 14:00 [PATCH] pci: Workaround Stratus broken PCIE hierarchy Prarit Bhargava
2011-11-10 14:31 ` Matthew Wilcox
2011-11-10 16:50   ` Don Dutile
2011-11-11 17:41     ` James Paradis
2011-11-11 19:13       ` Don Dutile
2011-11-11 20:29         ` Bjorn Helgaas
2011-11-11 20:35           ` Don Dutile
2011-11-14 14:44             ` Prarit Bhargava
2011-11-14 18:14               ` Matthew Wilcox
2011-11-14 19:50                 ` Prarit Bhargava
2011-11-15 20:16                   ` Matthew Wilcox
2011-11-15 15:56                 ` Prarit Bhargava
2011-11-15 16:08                   ` Rolf Eike Beer
2011-11-15 18:14                     ` Bjorn Helgaas
2011-11-15 18:25                       ` Prarit Bhargava
2011-11-15 21:08                         ` James Paradis
2011-11-15 21:52                           ` Myron Stowe
2011-11-15 22:14                             ` James Paradis
2011-11-15 20:15                   ` Matthew Wilcox [this message]
2011-11-16 16:53                     ` Prarit Bhargava
2011-11-17  0:18                       ` Prarit Bhargava
2011-11-15 21:53                   ` James Paradis
2011-11-15 22:27           ` James Paradis
2011-11-15 23:07             ` Don Dutile
  -- strict thread matches above, loose matches on Subject: below --
2012-04-25 17:56 Prarit Bhargava
2012-04-25 23:35 ` 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=20111115201536.GF4387@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=bhelgaas@google.com \
    --cc=ddutile@redhat.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jparadis@redhat.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mstowe@redhat.com \
    --cc=prarit@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.