From 525bcdd725bfe8f3ddf0324dc19bf542226dbf71 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Apr 20 2023 11:00:21 +0000 Subject: clk: rs9: Fix suspend/resume (bsc#1012628). --- diff --git a/patches.kernel.org/6.2.12-040-clk-rs9-Fix-suspend-resume.patch b/patches.kernel.org/6.2.12-040-clk-rs9-Fix-suspend-resume.patch new file mode 100644 index 0000000..6db7fe9 --- /dev/null +++ b/patches.kernel.org/6.2.12-040-clk-rs9-Fix-suspend-resume.patch @@ -0,0 +1,44 @@ +From: Alexander Stein +Date: Fri, 10 Mar 2023 08:49:40 +0100 +Subject: [PATCH] clk: rs9: Fix suspend/resume +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: 632e04739c8f45c2d9ca4d4c5bd18d80c2ac9296 + +[ Upstream commit 632e04739c8f45c2d9ca4d4c5bd18d80c2ac9296 ] + +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 +Link: https://lore.kernel.org/r/20230310074940.3475703-1-alexander.stein@ew.tq-group.com +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + 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 e6247141..3e98a16e 100644 +--- a/drivers/clk/clk-renesas-pcie.c ++++ b/drivers/clk/clk-renesas-pcie.c +@@ -144,8 +144,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.35.3 + diff --git a/series.conf b/series.conf index a68662f..4194491 100644 --- a/series.conf +++ b/series.conf @@ -2267,6 +2267,7 @@ patches.kernel.org/6.2.12-037-RDMA-erdma-Update-default-EQ-depth-to-4096-and.patch patches.kernel.org/6.2.12-038-RDMA-erdma-Inline-mtt-entries-into-WQE-if-supp.patch patches.kernel.org/6.2.12-039-RDMA-erdma-Defer-probing-if-netdevice-can-not-.patch + patches.kernel.org/6.2.12-040-clk-rs9-Fix-suspend-resume.patch ######################################################## # Build fixes that apply to the vanilla kernel too.