All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Richard Zhu <richard.zhu@freescale.com>
Cc: linux-pci@vger.kernel.org, shawn.guo@freescale.com,
	festevam@gmail.com, l.stach@pengutronix.de,
	tharvey@gateworks.com, m-karicheri2@ti.com,
	Richard Zhu <r65037@freescale.com>
Subject: Re: [PATCH V3] PCI: imx6: Wait the clocks to stabilize after ref_en
Date: Wed, 29 Oct 2014 10:20:05 -0600	[thread overview]
Message-ID: <20141029162005.GC12090@google.com> (raw)
In-Reply-To: <1414387052-3582-2-git-send-email-richard.zhu@freescale.com>

On Mon, Oct 27, 2014 at 01:17:32PM +0800, Richard Zhu wrote:
> From: Richard Zhu <r65037@freescale.com>
> 
> For boards without a reset GPIO we skip the delay between enabling the
> pcie_ref_clk and touching the RC registers for configuration.
> This hangs the system if there isn't a proper delay to ensure the clocks
> are settled in the DW PCIe core.
> 
> Also iMX6Q always needs an additional 10us delay to make sure the reset
> is propagated through the core, as we don't have an explicitly
> controlled reset input on this SoC.
> 
> Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
> Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
> Acked-by: Lucas Stach <l.stach@pengutronix.de>

I added the regression info to the changelog and applied this to for-linus
for v3.18, thanks!

> ---
>  drivers/pci/host/pci-imx6.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
> index 233fe8a..eac96fb 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -275,15 +275,22 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
>  		goto err_pcie;
>  	}
>  
> -	/* allow the clocks to stabilize */
> -	usleep_range(200, 500);
> -
>  	/* power up core phy and enable ref clock */
>  	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
>  			IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18);
> +	/*
> +	 * the async reset input need ref clock to sync internally,
> +	 * when the ref clock comes after reset, internal synced
> +	 * reset time is too short , cannot meet the requirement.
> +	 * add one ~10us delay here.
> +	 */
> +	udelay(10);
>  	regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
>  			IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
>  
> +	/* allow the clocks to stabilize */
> +	usleep_range(200, 500);
> +
>  	/* Some boards don't have PCIe reset GPIO. */
>  	if (gpio_is_valid(imx6_pcie->reset_gpio)) {
>  		gpio_set_value(imx6_pcie->reset_gpio, 0);
> -- 
> 1.9.1
> 

      reply	other threads:[~2014-10-29 16:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27  5:17 [PATCH V3]PCI: imx6: Wait the clocks to stabilize after ref_en Richard Zhu
2014-10-27  5:17 ` [PATCH V3] PCI: " Richard Zhu
2014-10-29 16:20   ` Bjorn Helgaas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141029162005.GC12090@google.com \
    --to=bhelgaas@google.com \
    --cc=festevam@gmail.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-pci@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=r65037@freescale.com \
    --cc=richard.zhu@freescale.com \
    --cc=shawn.guo@freescale.com \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.