From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net ([212.18.0.9]:60637 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751919Ab3LCJcu (ORCPT ); Tue, 3 Dec 2013 04:32:50 -0500 From: Marek Vasut To: Harro Haan Subject: Re: [PATCH 4/7] PCI: imx6: Split away the PHY reset Date: Tue, 3 Dec 2013 00:36:09 +0100 Cc: "linux-arm-kernel@lists.infradead.org" , linux-pci@vger.kernel.org, Bjorn Helgaas , Frank Li , Jingoo Han , Mohit KUMAR , Pratyush Anand , Richard Zhu , Sascha Hauer , Sean Cross , Shawn Guo , Siva Reddy Kallam , Srikanth T Shivanand , Tim Harvey , Troy Kisky , Yinghai Lu References: <1385500248-6551-1-git-send-email-marex@denx.de> <1385500248-6551-4-git-send-email-marex@denx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Message-Id: <201312030036.09886.marex@denx.de> Sender: linux-pci-owner@vger.kernel.org List-ID: Dear Harro Haan, > On 26 November 2013 22:10, Marek Vasut wrote: > > Split the PCIe PHY reset from the link up function to make > > the code a little more structured. > > > > Signed-off-by: Marek Vasut > > Cc: Bjorn Helgaas > > Cc: Frank Li > > Cc: Harro Haan > > Cc: Jingoo Han > > Cc: Mohit KUMAR > > Cc: Pratyush Anand > > Cc: Richard Zhu > > Cc: Sascha Hauer > > Cc: Sean Cross > > Cc: Shawn Guo > > Cc: Siva Reddy Kallam > > Cc: Srikanth T Shivanand > > Cc: Tim Harvey > > Cc: Troy Kisky > > Cc: Yinghai Lu > > --- > > > > drivers/pci/host/pci-imx6.c | 33 ++++++++++++++++++--------------- > > 1 file changed, 18 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c > > index 4d5be4e..a9781e7 100644 > > --- a/drivers/pci/host/pci-imx6.c > > +++ b/drivers/pci/host/pci-imx6.c > > @@ -336,6 +336,23 @@ static void imx6_pcie_host_init(struct pcie_port > > *pp) > > > > return; > > > > } > > > > +static void imx6_pcie_reset_phy(struct pcie_port *pp) > > +{ > > + uint32_t temp; > > + > > + pcie_phy_read(pp->dbi_base, PHY_RX_OVRD_IN_LO, &temp); > > + temp |= (PHY_RX_OVRD_IN_LO_RX_DATA_EN | > > + PHY_RX_OVRD_IN_LO_RX_PLL_EN); > > + pcie_phy_write(pp->dbi_base, PHY_RX_OVRD_IN_LO, temp); > > + > > + usleep_range(2000, 3000); > > + > > + pcie_phy_read(pp->dbi_base, PHY_RX_OVRD_IN_LO, &temp); > > + temp &= ~(PHY_RX_OVRD_IN_LO_RX_DATA_EN | > > + PHY_RX_OVRD_IN_LO_RX_PLL_EN); > > + pcie_phy_write(pp->dbi_base, PHY_RX_OVRD_IN_LO, temp); > > +} > > + > > > > static int imx6_pcie_link_up(struct pcie_port *pp) > > { > > > > u32 rc, ltssm, rx_valid, temp; > > > > @@ -370,21 +387,7 @@ static int imx6_pcie_link_up(struct pcie_port *pp) > > > > dev_err(pp->dev, "transition to gen2 is stuck, reset PHY!\n"); > > > > - pcie_phy_read(pp->dbi_base, > > - PHY_RX_OVRD_IN_LO, &temp); > > - temp |= (PHY_RX_OVRD_IN_LO_RX_DATA_EN > > - | PHY_RX_OVRD_IN_LO_RX_PLL_EN); > > - pcie_phy_write(pp->dbi_base, > > - PHY_RX_OVRD_IN_LO, temp); > > - > > - usleep_range(2000, 3000); > > - > > - pcie_phy_read(pp->dbi_base, > > - PHY_RX_OVRD_IN_LO, &temp); > > - temp &= ~(PHY_RX_OVRD_IN_LO_RX_DATA_EN > > - | PHY_RX_OVRD_IN_LO_RX_PLL_EN); > > - pcie_phy_write(pp->dbi_base, > > - PHY_RX_OVRD_IN_LO, temp); > > + imx6_pcie_reset_phy(pp); > > > > return 0; > > > > } > > > > -- > > 1.8.4.3 > > Thanks Marek, > > A minor: > drivers/pci/host/pci-imx6.c: In function 'imx6_pcie_link_up': > drivers/pci/host/pci-imx6.c:353:27: warning: unused variable 'temp' > [-Wunused-variable] > > See the following mail for more info which tests I did with patch 1/7, > 3/7, 4/7, 5/7 and 6/7: > http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/214640. > html Thanks for the find and testing!