summaryrefslogtreecommitdiffstats
path: root/drivers/clk/meson
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2022-11-22 16:25:08 -0800
committerStephen Boyd <sboyd@kernel.org>2022-11-22 16:25:08 -0800
commitd0b1c69288cf0f6b68eac0ebdf96d3e2d89f61df (patch)
tree79ee0e88858d7c3784e8fe6bd1982827fdfd3622 /drivers/clk/meson
parent9abf2313adc1ca1b6180c508c25f22f9395cc780 (diff)
parentd73406ed2dcfab7d25493ff3a62dd57f0d9c2bf2 (diff)
downloadlinux-d0b1c69288cf0f6b68eac0ebdf96d3e2d89f61df.tar.gz
linux-d0b1c69288cf0f6b68eac0ebdf96d3e2d89f61df.tar.bz2
linux-d0b1c69288cf0f6b68eac0ebdf96d3e2d89f61df.zip
Merge tag 'clk-meson-v6.2-1' of https://github.com/BayLibre/clk-meson into clk-amlogic
Pull Amlogic clk driver updates from Jerome Brunet: - Add 2 PLL driver fixups * tag 'clk-meson-v6.2-1' of https://github.com/BayLibre/clk-meson: clk: meson: pll: add pcie lock retry workaround clk: meson: pll: adjust timeout in meson_clk_pll_wait_lock()
Diffstat (limited to 'drivers/clk/meson')
-rw-r--r--drivers/clk/meson/clk-pll.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
index 9e55617bc3b4..5dfb7d38f452 100644
--- a/drivers/clk/meson/clk-pll.c
+++ b/drivers/clk/meson/clk-pll.c
@@ -277,15 +277,15 @@ static int meson_clk_pll_wait_lock(struct clk_hw *hw)
{
struct clk_regmap *clk = to_clk_regmap(hw);
struct meson_clk_pll_data *pll = meson_clk_pll_data(clk);
- int delay = 24000000;
+ int delay = 5000;
do {
- /* Is the clock locked now ? */
+ /* Is the clock locked now ? Time out after 100ms. */
if (meson_parm_read(clk->map, &pll->l))
return 0;
- delay--;
- } while (delay > 0);
+ udelay(20);
+ } while (--delay);
return -ETIMEDOUT;
}
@@ -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)
{
- meson_clk_pll_init(hw);
+ int retries = 10;
- if (meson_clk_pll_wait_lock(hw))
- return -EIO;
+ 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);
- return 0;
+ return -EIO;
}
static int meson_clk_pll_enable(struct clk_hw *hw)