Re: [PATCH v4 11/11] PCI: imx6: Use usleep_range() in imx6_pcie_enable_ref_clk()

From: Lucas Stach
Date: Mon Apr 15 2019 - 04:38:55 EST


Am Sonntag, den 14.04.2019, 17:46 -0700 schrieb Andrey Smirnov:
> imx6_pcie_enable_ref_clk() is never called in atomic context, so
> there's no need to use udelay(). Replace it with usleep_range().
>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
> Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> Cc: Chris Healy <cphealy@xxxxxxxxx>
> Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: linux-pci@xxxxxxxxxxxxxxx

Reviewed-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>

> ---
> Âdrivers/pci/controller/dwc/pci-imx6.c | 2 +-
> Â1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 3e45f49b8a4f..c6d6bde4d860 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -449,7 +449,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
> > Â Â* reset time is too short, cannot meet the requirement.
> > Â Â* add one ~10us delay here.
> > Â Â*/
> > - udelay(10);
> > + usleep_range(10, 100);
> > Â regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
> > Â ÂÂÂIMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
> > Â break;