Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753161AbcD1QVU (ORCPT ); Thu, 28 Apr 2016 12:21:20 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:51716 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753028AbcD1QVQ (ORCPT ); Thu, 28 Apr 2016 12:21:16 -0400 Message-ID: <1461860459.1169.54.camel@decadent.org.uk> Subject: Re: [PATCH 3.16 003/217] PCI: imx6: Move PHY reset into imx6_pcie_establish_link() From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: akpm@linux-foundation.org, Lucas Stach , Bjorn Helgaas Date: Thu, 28 Apr 2016 18:20:59 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-iXhZezM66Tj2wTTyqkDh" X-Mailer: Evolution 3.18.5.1-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 195.245.225.248 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4173 Lines: 124 --=-iXhZezM66Tj2wTTyqkDh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2016-04-27 at 01:02 +0200, Ben Hutchings wrote: > 3.16.35-rc1 review patch.=C2=A0=C2=A0If anyone has any objections, please= let me know. >=20 > ------------------ >=20 > From: Lucas Stach >=20 > commit 54a47a83421a3b7ee0e0fab7f65d04179bdf59b6 upstream. >=20 > This adds the PHY reset into a common error path of > imx6_pcie_establish_link(), deduplicating some of the debug prints.=C2=A0= =C2=A0Also > 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=C2=A053eeb48b4941 ("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 > Signed-off-by: Bjorn Helgaas > [bwh: Backported to 3.16: > =C2=A0- Error paths were different in imx6_pcie_start_link() > =C2=A0- Adjust context] > Signed-off-by: Ben Hutchings > --- > =C2=A0drivers/pci/host/pci-imx6.c | 28 +++++++++++++++------------- > =C2=A01 file changed, 15 insertions(+), 13 deletions(-) >=20 > --- 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 > =C2=A0 if (--count) > =C2=A0 continue; > =C2=A0 > - 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)); > =C2=A0 return -EINVAL; > =C2=A0 } > =C2=A0 > @@ -343,8 +339,10 @@ static int imx6_pcie_start_link(struct p > =C2=A0 IMX6Q_GPR12_PCIE_CTL_2, 1 << 10); > =C2=A0 > =C2=A0 ret =3D 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; > + } > =C2=A0 > =C2=A0 /* Allow Gen2 mode after the link is up. */ > =C2=A0 tmp =3D readl(pp->dbi_base + PCIE_RC_LCR); > @@ -377,12 +375,21 @@ static int imx6_pcie_start_link(struct p > =C2=A0 > =C2=A0 if (ret) { > =C2=A0 dev_err(pp->dev, "Failed to bring link up!\n"); > + goto err_reset_phy; > =C2=A0 } else { > =C2=A0 tmp =3D readl(pp->dbi_base + 0x80); > =C2=A0 dev_dbg(pp->dev, "Link up, Gen=3D%i\n", (tmp >> 16) & 0xf); > =C2=A0 } > =C2=A0 > =C2=A0 return ret; > + > +err_reset_phy: > + dev_dbg(pp->dev, "PHY DEBUG_R0=3D0x%08x DEBUG_R1=3D0x%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; > =C2=A0} > =C2=A0 > =C2=A0static void imx6_pcie_host_init(struct pcie_port *pp) > @@ -470,11 +477,6 @@ static int imx6_pcie_link_up(struct pcie > =C2=A0 if ((debug_r0 & 0x3f) !=3D 0x0d) > =C2=A0 return 0; > =C2=A0 > - dev_err(pp->dev, "transition to gen2 is stuck, reset PHY!\n"); > - dev_dbg(pp->dev, "debug_r0=3D%08x debug_r1=3D%08x\n", debug_r0, rc); > - > - imx6_pcie_reset_phy(pp); > - > =C2=A0 return 0; > =C2=A0} > =C2=A0 --=20 Ben Hutchings All extremists should be taken out and shot. --=-iXhZezM66Tj2wTTyqkDh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJXIjhrAAoJEOe/yOyVhhEJBOwQANAFAkz5wa4mvXXB0bnZY5Ji DuU2Cbh/UrBXvFCh/aC5tA6pffpWlv9Lk/918vByXyel8zyHQzpf1cdFB7lXn3ss VvnB6SHD8pAq/hg4MLZ77FNnVWDJotU6xx+/Ex2ZC2rbvkaVsbwGzi/MWc63J1ow qDWKydEly37KyOch/Twp98fq9Mm/5JwC9Hf3GWMnlg1r66nMcJox20ZyQcb/4xke Mw4xG6uvSXJQMJCnTpiDh7xUpPwlRhnjle4cxA8lC8gmaTZdkJ4CsEOrI4j+d168 4Eb1ZWdjJU1VOoP2gBOEE2AVz74K7OUueY4JnPcStAwAxCynJws3bNiZSHx4sxJK YN0BpaeJMYv9ecdgeDvegFhPfe/h9wVf3fdEtvjofjQDTjwK/Cjgzfeg7D9oLcGr LGjFzzJ/piJfVrljku1qeoMvkBhn8b86KMkn1IkQxX8J6cVBN7hMTnMTVuL3chEw hg0rSZeDKwDo0MGoxvw+G2DCZAQ/eCknbFSabnnywehNIiPSYVy78rU50jDxO2UX ovVW1AD3R2aWknvjyOCVVzj/RpPyMoOhb5WW4+1eWtddv9/eC/IYvNOXX04QDLiH HjZt9oYmDlfW/9+KaiSSmXhbHcsA1POYELv4Q33gq7kvXOY0eFiZwquQl4Mg2DsR NoM1cqK++EKx2s7gx9eB =N5ca -----END PGP SIGNATURE----- --=-iXhZezM66Tj2wTTyqkDh--