[PATCH v3 3/3] clk: rp1: reset cached rates on probe
From: Joshua Covington
Date: Tue Nov 24 2026 - 18:18:34 EST
The clock descriptors are static, so their cached rates survive when
RP1 is unbound and bound again. The "varsrc" clocks then report the
rate of the previous probe, and the audio PLL and I2S clocks start with
stale cached values.
Reset the cached rates before registering the clocks, so that a second
probe starts from the same state as the first.
Fixes: 6486341721a2 ("clk: rp1: Add support for clocks provided by RP1")
Signed-off-by: Joshua Covington <joshuacov@xxxxxxxxx>
---
drivers/clk/clk-rp1.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/clk/clk-rp1.c b/drivers/clk/clk-rp1.c
index 1dd276dd2b..60037b19db 100644
--- a/drivers/clk/clk-rp1.c
+++ b/drivers/clk/clk-rp1.c
@@ -2416,6 +2416,12 @@ static int rp1_clk_probe(struct platform_device *pdev)
clockman->onecell.num = asize;
hws = clockman->onecell.hws;
+ for (i = 0; i < asize; i++) {
+ desc = clk_desc_array[i];
+ if (desc)
+ desc->cached_rate = 0;
+ }
+
for (i = 0; i < asize; i++) {
desc = clk_desc_array[i];
if (desc && desc->clk_register && desc->data)
--
2.56.0