* [PATCH] clk: versaclock5: restore cache_only on regcache_sync() failure in resume
@ 2026-07-24 7:46 phucduc.bui
2026-07-24 18:58 ` Brian Masney
0 siblings, 1 reply; 2+ messages in thread
From: phucduc.bui @ 2026-07-24 7:46 UTC (permalink / raw)
To: Luca Ceresoli, Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
If regcache_sync() fails in vc5_resume(), the function only logs the
error, leaving regmap with cache_only disabled even though the register
cache has not been synchronized with the hardware.
Re-enable cache_only on failure to restore the state established by
vc5_suspend().
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/clk/clk-versaclock5.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
index 913fcc5675f1..d87899118905 100644
--- a/drivers/clk/clk-versaclock5.c
+++ b/drivers/clk/clk-versaclock5.c
@@ -1240,8 +1240,10 @@ static int __maybe_unused vc5_resume(struct device *dev)
regcache_cache_only(vc5->regmap, false);
ret = regcache_sync(vc5->regmap);
- if (ret)
+ if (ret) {
+ regcache_cache_only(vc5->regmap, true);
dev_err(dev, "Failed to restore register map: %d\n", ret);
+ }
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: versaclock5: restore cache_only on regcache_sync() failure in resume
2026-07-24 7:46 [PATCH] clk: versaclock5: restore cache_only on regcache_sync() failure in resume phucduc.bui
@ 2026-07-24 18:58 ` Brian Masney
0 siblings, 0 replies; 2+ messages in thread
From: Brian Masney @ 2026-07-24 18:58 UTC (permalink / raw)
To: phucduc.bui
Cc: Luca Ceresoli, Michael Turquette, Stephen Boyd, linux-clk,
linux-kernel
Hi bui,
On Fri, Jul 24, 2026 at 02:46:03PM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> If regcache_sync() fails in vc5_resume(), the function only logs the
> error, leaving regmap with cache_only disabled even though the register
> cache has not been synchronized with the hardware.
> Re-enable cache_only on failure to restore the state established by
> vc5_suspend().
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
> drivers/clk/clk-versaclock5.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
> index 913fcc5675f1..d87899118905 100644
> --- a/drivers/clk/clk-versaclock5.c
> +++ b/drivers/clk/clk-versaclock5.c
> @@ -1240,8 +1240,10 @@ static int __maybe_unused vc5_resume(struct device *dev)
>
> regcache_cache_only(vc5->regmap, false);
> ret = regcache_sync(vc5->regmap);
> - if (ret)
> + if (ret) {
> + regcache_cache_only(vc5->regmap, true);
> dev_err(dev, "Failed to restore register map: %d\n", ret);
> + }
> return ret;
> }
I don't see precedent for this pattern anywhere else in the tree. Is
this an observed problem or something that could theoretically happen?
If this fails in the code today, the pm core will propagate the error,
and the device won't be marked as resumed.
Brian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-24 18:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 7:46 [PATCH] clk: versaclock5: restore cache_only on regcache_sync() failure in resume phucduc.bui
2026-07-24 18:58 ` Brian Masney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox