Re: [PATCH v2] clk: zynq: return -ETIMEDOUT if the PLL never locks
From: Michal Simek
Date: Tue Nov 10 2026 - 08:51:10 EST
On 9/8/26 10:47, Linkai Gong wrote:
zynq_pll_enable() waits for lock under a spinlock with no timeout.Tested-by: Michal Simek <michal.simek@xxxxxxx>
A stuck PLL would wedge the enable path with IRQs off.
Poll with readl_poll_timeout_atomic() and return -ETIMEDOUT on
failure. The 1 ms upper bound is a software limit for a stuck PLL,
not a TRM-derived value; Zynq PLL lock is still expected well
within that window.
Changes in v2:
- Use BIT(clk->lockbit)
- Name the poll delay/timeout constants
- Clarify the 1 ms bound in the commit message
Fixes: 3682af46d55f ("clk: zynq: Factor out PLL driver")
Signed-off-by: Linkai Gong <gonglinkai@xxxxxxxxxx>
---
drivers/clk/zynq/pll.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
Thanks,
Michal