From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28493C10F0E for ; Mon, 15 Apr 2019 08:36:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3AA120651 for ; Mon, 15 Apr 2019 08:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725796AbfDOIgz (ORCPT ); Mon, 15 Apr 2019 04:36:55 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:40555 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbfDOIgz (ORCPT ); Mon, 15 Apr 2019 04:36:55 -0400 Received: from kresse.hi.pengutronix.de ([2001:67c:670:100:1d::2a]) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1hFx6j-0004Dg-7j; Mon, 15 Apr 2019 10:36:53 +0200 Message-ID: <1555317412.2983.0.camel@pengutronix.de> Subject: Re: [PATCH v4 02/11] PCI: imx6: Drop imx6_pcie_wait_for_link() From: Lucas Stach To: Andrey Smirnov , linux-pci@vger.kernel.org Cc: Lorenzo Pieralisi , Bjorn Helgaas , Chris Healy , linux-kernel@vger.kernel.org Date: Mon, 15 Apr 2019 10:36:52 +0200 In-Reply-To: <20190415004632.5907-3-andrew.smirnov@gmail.com> References: <20190415004632.5907-1-andrew.smirnov@gmail.com> <20190415004632.5907-3-andrew.smirnov@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::2a X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pci@vger.kernel.org Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Am Sonntag, den 14.04.2019, 17:46 -0700 schrieb Andrey Smirnov: > All calls to imx6_pcie_wait_for_link() share the same error path and > the state of PHY debug registers will already be printed there, so > there's no real reason we can't just use dw_pcie_wait_for_link(). Drop > imx6_pcie_wait_for_link() and replace it with dw_pcie_wait_for_link(). > > > Signed-off-by: Andrey Smirnov > > Suggested-by: Lucas Stach > > Cc: Lorenzo Pieralisi > > Cc: Bjorn Helgaas > > Cc: Chris Healy > > Cc: Lucas Stach > Cc: linux-kernel@vger.kernel.org > Cc: linux-pci@vger.kernel.org Reviewed-by: Lucas Stach > --- >  drivers/pci/controller/dwc/pci-imx6.c | 19 ++----------------- >  1 file changed, 2 insertions(+), 17 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c > index ea2617712a3b..bb3dcfdbf697 100644 > --- a/drivers/pci/controller/dwc/pci-imx6.c > +++ b/drivers/pci/controller/dwc/pci-imx6.c > @@ -723,21 +723,6 @@ static int imx6_setup_phy_mpll(struct imx6_pcie *imx6_pcie) > >   return 0; >  } >   > -static int imx6_pcie_wait_for_link(struct imx6_pcie *imx6_pcie) > -{ > > - struct dw_pcie *pci = imx6_pcie->pci; > > - struct device *dev = pci->dev; > - > > - /* check if the link is up or not */ > > - if (!dw_pcie_wait_for_link(pci)) > > - return 0; > - > > - dev_dbg(dev, "DEBUG_R0: 0x%08x, DEBUG_R1: 0x%08x\n", > > - dw_pcie_readl_dbi(pci, PCIE_PHY_DEBUG_R0), > > - dw_pcie_readl_dbi(pci, PCIE_PHY_DEBUG_R1)); > > - return -ETIMEDOUT; > -} > - >  static int imx6_pcie_wait_for_speed_change(struct imx6_pcie *imx6_pcie) >  { > >   struct dw_pcie *pci = imx6_pcie->pci; > @@ -796,7 +781,7 @@ static int imx6_pcie_establish_link(struct imx6_pcie *imx6_pcie) > >   /* Start LTSSM. */ > >   imx6_pcie_ltssm_enable(dev); >   > > - ret = imx6_pcie_wait_for_link(imx6_pcie); > > + ret = dw_pcie_wait_for_link(pci); > >   if (ret) > >   goto err_reset_phy; >   > @@ -834,7 +819,7 @@ static int imx6_pcie_establish_link(struct imx6_pcie *imx6_pcie) > >   } >   > >   /* Make sure link training is finished as well! */ > > - ret = imx6_pcie_wait_for_link(imx6_pcie); > > + ret = dw_pcie_wait_for_link(pci); > >   if (ret) { > >   dev_err(dev, "Failed to bring link up!\n"); > >   goto err_reset_phy;