Commit d73406ed authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Jerome Brunet
Browse files

clk: meson: pll: add pcie lock retry workaround



The PCIe PLL locking may be unreliable under some circumstance, such as
high or low temperature. If the PLL fails to lock, reset it a try again.

This helps on the S905X4

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
[commit message amend]
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/cc80cda0-4dda-2e3e-3fc8-afa97717479b@gmail.com
parent 19648ddd
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -320,12 +320,16 @@ static int meson_clk_pll_is_enabled(struct clk_hw *hw)

static int meson_clk_pcie_pll_enable(struct clk_hw *hw)
{
	int retries = 10;

	do {
		meson_clk_pll_init(hw);
		if (!meson_clk_pll_wait_lock(hw))
			return 0;
		pr_info("Retry enabling PCIe PLL clock\n");
	} while (--retries);

	if (meson_clk_pll_wait_lock(hw))
	return -EIO;

	return 0;
}

static int meson_clk_pll_enable(struct clk_hw *hw)