Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1538866 > unrolled thread

Re: [PATCH] PCI/ASPM: Don't retrain link if ASPM not possible.

Started byBjorn Helgaas <helgaas@kernel.org>
First post2016-12-08 21:50 +0100
Last post2016-12-08 21:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] PCI/ASPM: Don't retrain link if ASPM not possible. Bjorn Helgaas <helgaas@kernel.org> - 2016-12-08 21:50 +0100

#1538866 — Re: [PATCH] PCI/ASPM: Don't retrain link if ASPM not possible.

FromBjorn Helgaas <helgaas@kernel.org>
Date2016-12-08 21:50 +0100
SubjectRe: [PATCH] PCI/ASPM: Don't retrain link if ASPM not possible.
Message-ID<sMdND-2nu-11@gated-at.bofh.it>
On Thu, Nov 17, 2016 at 02:25:01PM -0800, David Daney wrote:
> From: David Daney <david.daney@cavium.com>
> 
> Some (defective) PCIe devices are not able to reliably do link
> retraining.
> 
> Check to see if ASPM is possible between link partners before
> configuring common clocking, and doing the resulting link retraining.
> If ASPM is not possible, there is no reason to risk losing access to a
> device due to an unnecessary link retraining.
> 
> Signed-off-by: David Daney <david.daney@cavium.com>

Applied to pci/aspm for v4.10, thanks, David!

> ---
>  drivers/pci/pcie/aspm.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index 0ec649d..d6667db 100644
> --- a/drivers/pci/pcie/aspm.c
> +++ b/drivers/pci/pcie/aspm.c
> @@ -351,12 +351,26 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
>  		return;
>  	}
>  
> +	/* Get upstream/downstream components' register state */
> +	pcie_get_aspm_reg(parent, &upreg);
> +	child = list_entry(linkbus->devices.next, struct pci_dev, bus_list);
> +	pcie_get_aspm_reg(child, &dwreg);
> +
> +	/*
> +	 * If ASPM not supported, don't mess with the clocks and link,
> +	 * bail out now.
> +	 */
> +	if (!(upreg.support & dwreg.support))
> +		return;
> +
>  	/* Configure common clock before checking latencies */
>  	pcie_aspm_configure_common_clock(link);
>  
> -	/* Get upstream/downstream components' register state */
> +	/*
> +	 * Re-read upstream/downstream components' register state
> +	 * after clock configuration
> +	 */
>  	pcie_get_aspm_reg(parent, &upreg);
> -	child = list_entry(linkbus->devices.next, struct pci_dev, bus_list);
>  	pcie_get_aspm_reg(child, &dwreg);
>  
>  	/*
> -- 
> 1.7.11.7
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web