Skip to contentSkip to conversation

clk: meson: pll: adjust timeout in meson_clk_pll_wait_lock()

PATCH Applied Heiner Kallweit 3 participants 5 messages Aug 29, 2022 – Oct 22, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clk: meson: pll: adjust timeout in meson_clk_pll_wait_lock()

Currently we loop over meson_parm_read() up to 24mln times. This results in a unpredictable timeout period. In my case it's over 5s on a S905X4-based system. Make the timeout period predictable and set it to 100ms.

---
v2:
- remove an unrelated change

---
 drivers/clk/meson/clk-pll.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/meson/clk-pll.c +4 -4
index daa025b6d..53b8e17e4 100644
@@ -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;
 }
Signature · 1 line
2.37.2
maintainer Applied
#1 lore raw
Quoted 4 lines · Heiner Kallweit

Currently we loop over meson_parm_read() up to 24mln times. This results in a unpredictable timeout period. In my case it's over 5s on a S905X4-based system. Make the timeout period predictable and set it to 100ms.

Nitpick: next time please try to make commit not about your system, but about the system and the codebase.

For example: In my case -> on an S905X4 platform (even better if you precise the platform here). Thx.

Quoted 2 lines

Applied, Thx

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#2 lore raw
In reply to Heiner Kallweit
Quoted 27 lines · Heiner Kallweit

Currently we loop over meson_parm_read() up to 24mln times. This results in a unpredictable timeout period. In my case it's over 5s on a S905X4-based system. Make the timeout period predictable and set it to 100ms.

---
v2:
- remove an unrelated change

---
 drivers/clk/meson/clk-pll.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/meson/clk-pll.c +2 -2
index daa025b6d..53b8e17e4 100644
@@ -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. */

drivers/clk/meson/clk-pll.c static int meson_clk_pll_wait_lock(struct clk_hw *hw) · line 291

Quoted 10 lines
drivers/clk/meson/clk-pll.c +2 -2
 		if (meson_parm_read(clk->map, &pll->l))
 			return 0;
 
-		delay--;
-	} while (delay > 0);
+		udelay(20);
+	} while (--delay);
 
 	return -ETIMEDOUT;
 }

Hi Jerome,
on Sep 6th you responded that the patch has been applied.
https://patchwork.kernel.org/project/linux-amlogic/patch/[email protected]/
However I still don't see it in linux-next. Is it pending in some other tree?

Heiner

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#3 lore raw

Hi Heiner,

On Sat, Oct 22, 2022 at 1:17 PM Heiner Kallweit <[email protected]> wrote:
[...]

Quoted 4 lines

Hi Jerome,
on Sep 6th you responded that the patch has been applied.
https://patchwork.kernel.org/project/linux-amlogic/patch/[email protected]/
However I still don't see it in linux-next. Is it pending in some other tree?

Jerome has merged both your patches and they are part of the linux-clk pull request, see [0]
But it seems like that hasn't been merged by the clock maintainers (Stephen) yet.

Do you have that other mail in your inbox? If so, can you please ping Stephen in that thread?

Best regards,
Martin

[0] https://lore.kernel.org/linux-amlogic/[email protected]/

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

maintainer
#4 lore raw
Quoted 8 lines · Martin Blumenstingl

Hi Heiner,

On Sat, Oct 22, 2022 at 1:17 PM Heiner Kallweit <[email protected]> wrote:
[...]

Quoted 4 lines

Hi Jerome,
on Sep 6th you responded that the patch has been applied.
https://patchwork.kernel.org/project/linux-amlogic/patch/[email protected]/
However I still don't see it in linux-next. Is it pending in some other tree?

Quoted 8 lines

Jerome has merged both your patches and they are part of the linux-clk pull request, see [0]
But it seems like that hasn't been merged by the clock maintainers (Stephen) yet.

Do you have that other mail in your inbox? If so, can you please ping Stephen in that thread?

Indeed, It missed the merged window. I'll send it again soon

Quoted 6 lines

Best regards,
Martin

[0] https://lore.kernel.org/linux-amlogic/[email protected]/