Re: [PATCH] pci: Workaround Stratus broken PCIE hierarchy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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."
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux