public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] clk: rs9: Fix suspend/resume
@ 2023-03-10  7:49 Alexander Stein
  2023-03-13 22:26 ` Stephen Boyd
  2023-03-21 17:47 ` Stephen Boyd
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Stein @ 2023-03-10  7:49 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Marek Vasut; +Cc: Alexander Stein, linux-clk

Disabling the cache in commit 2ff4ba9e3702 ("clk: rs9: Fix I2C accessors")
without removing cache synchronization in resume path results in a
kernel panic as map->cache_ops is unset, due to REGCACHE_NONE.
Enable flat cache again to support resume again. num_reg_defaults_raw
is necessary to read the cache defaults from hardware. Some registers
are strapped in hardware and cannot be provided in software.

Fixes: 2ff4ba9e3702 ("clk: rs9: Fix I2C accessors")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
There is also a series to not panic when using regcache_sync on
REGCACHE_NONE maps at [1].

[1] https://lore.kernel.org/lkml/20230310073911.3470892-1-alexander.stein@ew.tq-group.com/T/#u

 drivers/clk/clk-renesas-pcie.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-renesas-pcie.c b/drivers/clk/clk-renesas-pcie.c
index 1e8b196e36f3..3377ee55c4f0 100644
--- a/drivers/clk/clk-renesas-pcie.c
+++ b/drivers/clk/clk-renesas-pcie.c
@@ -149,8 +149,9 @@ static int rs9_regmap_i2c_read(void *context,
 static const struct regmap_config rs9_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
-	.cache_type = REGCACHE_NONE,
+	.cache_type = REGCACHE_FLAT,
 	.max_register = RS9_REG_BCP,
+	.num_reg_defaults_raw = 0x8,
 	.rd_table = &rs9_readable_table,
 	.wr_table = &rs9_writeable_table,
 	.reg_write = rs9_regmap_i2c_write,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-21 17:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10  7:49 [PATCH 1/1] clk: rs9: Fix suspend/resume Alexander Stein
2023-03-13 22:26 ` Stephen Boyd
2023-03-14  7:22   ` Alexander Stein
2023-03-20 19:35     ` Stephen Boyd
2023-03-21  6:20       ` Alexander Stein
2023-03-21 17:47 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox