public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Stefan Eichenberger <eichest@gmail.com>
Cc: hongxing.zhu@nxp.com, l.stach@pengutronix.de,
	lpieralisi@kernel.org, kw@linux.com, robh@kernel.org,
	bhelgaas@google.com, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	francesco.dolcini@toradex.com, linux-pci@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Stefan Eichenberger <stefan.eichenberger@toradex.com>
Subject: Re: [PATCH v1 2/3] PCI: imx6: move the wait for clock stabilization to enable ref clk
Date: Mon, 19 Aug 2024 10:45:13 -0400	[thread overview]
Message-ID: <ZsNaeV29s913HU6E@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20240819090428.17349-3-eichest@gmail.com>

On Mon, Aug 19, 2024 at 11:03:18AM +0200, Stefan Eichenberger wrote:
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>
> After enabling the ref clock, we should wait for the clock to stabilize.
> To eliminate the need for code duplication in the future, move the
> usleep to the enable_ref_clk function.

Logically, it's better wait in imx6_pcie_clk_enable(). But not sure why
it can reduce duplication.

Frank

>
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index fda704d82431f..f17561791e35a 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -632,6 +632,9 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
>  		break;
>  	}
>
> +	/* allow the clocks to stabilize */
> +	usleep_range(200, 500);
> +
>  	return ret;
>  }
>
> @@ -672,8 +675,6 @@ static int imx6_pcie_clk_enable(struct imx6_pcie *imx6_pcie)
>  		goto err_ref_clk;
>  	}
>
> -	/* allow the clocks to stabilize */
> -	usleep_range(200, 500);
>  	return 0;
>
>  err_ref_clk:
> --
> 2.43.0
>


  reply	other threads:[~2024-08-19 14:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19  9:03 [PATCH v1 0/3] PCI: imx6: reset link after suspend/resume Stefan Eichenberger
2024-08-19  9:03 ` [PATCH v1 1/3] PCI: imx6: Add a function to deassert the reset gpio Stefan Eichenberger
2024-08-19 14:49   ` Frank Li
2024-08-20  7:07     ` Stefan Eichenberger
2024-08-19  9:03 ` [PATCH v1 2/3] PCI: imx6: move the wait for clock stabilization to enable ref clk Stefan Eichenberger
2024-08-19 14:45   ` Frank Li [this message]
2024-08-20  7:06     ` Stefan Eichenberger
2024-08-19  9:03 ` [PATCH v1 3/3] PCI: imx6: reset link on resume Stefan Eichenberger
2024-08-19 14:39   ` Frank Li
2024-08-20  7:05     ` Stefan Eichenberger
2024-08-19 14:30 ` [PATCH v1 0/3] PCI: imx6: reset link after suspend/resume Frank Li
2024-08-20  6:52   ` Stefan Eichenberger
2024-08-21 15:41     ` Stefan Eichenberger
2024-08-21 16:51       ` Frank Li
2024-08-22  7:20         ` Stefan Eichenberger

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=ZsNaeV29s913HU6E@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=eichest@gmail.com \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=hongxing.zhu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=kw@linux.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan.eichenberger@toradex.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox