diff mbox series

[v3,02/11] PCI: imx6: Remove redundant debug tracing

Message ID 20190401042547.14067-3-andrew.smirnov@gmail.com
State Superseded
Delegated to: Lorenzo Pieralisi
Headers show
Series i.MX6, DesignWare PCI improvements | expand

Commit Message

Andrey Smirnov April 1, 2019, 4:25 a.m. UTC
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.

Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: "A.s. Dong" <aisheng.dong@nxp.com>
Cc: Richard Zhu <hongxing.zhu@nxp.com>
Cc: linux-imx@nxp.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/pci/controller/dwc/pci-imx6.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Lucas Stach April 12, 2019, 3:53 p.m. UTC | #1
Am Sonntag, den 31.03.2019, 21:25 -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.

With this change we can drop imx6_pcie_wait_for_link altogether, as
it's now just wrapper around dw_pcie_wait_for_link that pulls out the
dw_pcie struct from imx6_pcie. Both callers have dw_pcie already
available, so there is no point in keeping this function.

Regards,
Lucas

> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Fabio Estevam <fabio.estevam@nxp.com>
> > Cc: Chris Healy <cphealy@gmail.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> > Cc: Leonard Crestez <leonard.crestez@nxp.com>
> > Cc: "A.s. Dong" <aisheng.dong@nxp.com>
> > Cc: Richard Zhu <hongxing.zhu@nxp.com>
> Cc: linux-imx@nxp.com
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index fb0b29e5b1f0..7582d0b2fbe7 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -726,16 +726,9 @@ static int imx6_setup_phy_mpll(struct imx6_pcie *imx6_pcie)
>  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;
> > +	return dw_pcie_wait_for_link(pci);
>  }
>  
>  static int imx6_pcie_wait_for_speed_change(struct imx6_pcie *imx6_pcie)
Andrey Smirnov April 14, 2019, 6:47 p.m. UTC | #2
On Fri, Apr 12, 2019 at 8:53 AM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Am Sonntag, den 31.03.2019, 21:25 -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.
>
> With this change we can drop imx6_pcie_wait_for_link altogether, as
> it's now just wrapper around dw_pcie_wait_for_link that pulls out the
> dw_pcie struct from imx6_pcie. Both callers have dw_pcie already
> available, so there is no point in keeping this function.
>

Good point, will do.

Thanks,
Andrey Smirnov
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index fb0b29e5b1f0..7582d0b2fbe7 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -726,16 +726,9 @@  static int imx6_setup_phy_mpll(struct imx6_pcie *imx6_pcie)
 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;
+	return dw_pcie_wait_for_link(pci);
 }
 
 static int imx6_pcie_wait_for_speed_change(struct imx6_pcie *imx6_pcie)