lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1461860459.1169.54.camel@decadent.org.uk>
Date:	Thu, 28 Apr 2016 18:20:59 +0200
From:	Ben Hutchings <ben@...adent.org.uk>
To:	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc:	akpm@...ux-foundation.org, Lucas Stach <l.stach@...gutronix.de>,
	Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH 3.16 003/217] PCI: imx6: Move PHY reset into
 imx6_pcie_establish_link()

On Wed, 2016-04-27 at 01:02 +0200, Ben Hutchings wrote:
> 3.16.35-rc1 review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Lucas Stach <l.stach@...gutronix.de>
> 
> commit 54a47a83421a3b7ee0e0fab7f65d04179bdf59b6 upstream.
> 
> This adds the PHY reset into a common error path of
> imx6_pcie_establish_link(), deduplicating some of the debug prints.  Also
> reduce the severity of the "no-link" message in the one place where it is
> expected to be hit when no peripheral is attached.

This depends on commit 53eeb48b4941 ("PCI: imx6: Move
imx6_pcie_reset_phy() near other PHY handling functions"), so I've
added that to the series.

Ben.

> Signed-off-by: Lucas Stach <l.stach@...gutronix.de>
> Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
> [bwh: Backported to 3.16:
>  - Error paths were different in imx6_pcie_start_link()
>  - Adjust context]
> Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
> ---
>  drivers/pci/host/pci-imx6.c | 28 +++++++++++++++-------------
>  1 file changed, 15 insertions(+), 13 deletions(-)
> 
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -305,10 +305,6 @@ static int imx6_pcie_wait_for_link(struc
>  		if (--count)
>  			continue;
>  
> -		dev_err(pp->dev, "phy link never came up\n");
> -		dev_dbg(pp->dev, "DEBUG_R0: 0x%08x, DEBUG_R1: 0x%08x\n",
> -			readl(pp->dbi_base + PCIE_PHY_DEBUG_R0),
> -			readl(pp->dbi_base + PCIE_PHY_DEBUG_R1));
>  		return -EINVAL;
>  	}
>  
> @@ -343,8 +339,10 @@ static int imx6_pcie_start_link(struct p
>  			IMX6Q_GPR12_PCIE_CTL_2, 1 << 10);
>  
>  	ret = imx6_pcie_wait_for_link(pp);
> -	if (ret)
> -		return ret;
> +	if (ret) {
> +		dev_info(pp->dev, "Link never came up\n");
> +		goto err_reset_phy;
> +	}
>  
>  	/* Allow Gen2 mode after the link is up. */
>  	tmp = readl(pp->dbi_base + PCIE_RC_LCR);
> @@ -377,12 +375,21 @@ static int imx6_pcie_start_link(struct p
>  
>  	if (ret) {
>  		dev_err(pp->dev, "Failed to bring link up!\n");
> +		goto err_reset_phy;
>  	} else {
>  		tmp = readl(pp->dbi_base + 0x80);
>  		dev_dbg(pp->dev, "Link up, Gen=%i\n", (tmp >> 16) & 0xf);
>  	}
>  
>  	return ret;
> +
> +err_reset_phy:
> +	dev_dbg(pp->dev, "PHY DEBUG_R0=0x%08x DEBUG_R1=0x%08x\n",
> +		readl(pp->dbi_base + PCIE_PHY_DEBUG_R0),
> +		readl(pp->dbi_base + PCIE_PHY_DEBUG_R1));
> +	imx6_pcie_reset_phy(pp);
> +
> +	return ret;
>  }
>  
>  static void imx6_pcie_host_init(struct pcie_port *pp)
> @@ -470,11 +477,6 @@ static int imx6_pcie_link_up(struct pcie
>  	if ((debug_r0 & 0x3f) != 0x0d)
>  		return 0;
>  
> -	dev_err(pp->dev, "transition to gen2 is stuck, reset PHY!\n");
> -	dev_dbg(pp->dev, "debug_r0=%08x debug_r1=%08x\n", debug_r0, rc);
> -
> -	imx6_pcie_reset_phy(pp);
> -
>  	return 0;
>  }
>  

-- 
Ben Hutchings
All extremists should be taken out and shot.
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ