Skip to contentSkip to conversation

mfd:: Update Cirrus Logic drivers to use maple tree register caches

PATCH Applied Mark Brown 3 participants 16 messages Jul 13, 2023 – Jul 18, 2023

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover mfd:: Update Cirrus Logic drivers to use maple tree register caches

With the v6.5 merge window the maple tree register cache has acquired the ability to generate multi-register writes during sync operations, removing the last major limitation it had compared to the rbtree cache. As part of a general modernisation effort update the Cirrus Logic drivers to use the more modern data structure, realistically there is likely to be very little user visible impact either way but generally the implementation choices of the maple tree cache should be a bit better on modern hardware.

Signed-off-by Mark

---
Mark Brown (11):
mfd: cs47l15: Update to use maple tree register cache
mfd: cs47l24: Update to use maple tree register cache
mfd: cs47l35: Update to use maple tree register cache
mfd: cs47l85: Update to use maple tree register cache
mfd: cs47l90: Update to use maple tree register cache
mfd: cs47l92: Update to use maple tree register cache
mfd: wm5102: Update to use maple tree register cache
mfd: wm5110: Update to use maple tree register cache
mfd: wm8994: Update to use maple tree register cache
mfd: wm8997: Update to use maple tree register cache
mfd: wm8998: Update to use maple tree register cache

 drivers/mfd/cs47l15-tables.c | 8 ++++----
 drivers/mfd/cs47l24-tables.c | 2 +-
 drivers/mfd/cs47l35-tables.c | 8 ++++----
 drivers/mfd/cs47l85-tables.c | 8 ++++----
 drivers/mfd/cs47l90-tables.c | 8 ++++----
 drivers/mfd/cs47l92-tables.c | 8 ++++----
 drivers/mfd/wm5102-tables.c  | 2 +-
 drivers/mfd/wm5110-tables.c  | 2 +-
 drivers/mfd/wm8994-regmap.c  | 6 +++---
 drivers/mfd/wm8997-tables.c  | 2 +-
 drivers/mfd/wm8998-tables.c  | 2 +-
 11 files changed, 28 insertions(+), 28 deletions(-)

---
base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
change-id: 20230623-mfd-cirrus-maple-4b3286352baa

Best regards,

Signature · 1 line
Mark Brown <[email protected]>
author
#1 lore raw

PATCH 1/11 mfd: cs47l15: Update to use maple tree register cache

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the cs47l15 driver to use the more modern data structure.

---
 drivers/mfd/cs47l15-tables.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/cs47l15-tables.c +4 -4
index 3c77f0a24e9b..59b005cc1e33 100644
@@ -1249,7 +1249,7 @@ const struct regmap_config cs47l15_16bit_spi_regmap = {
 	.readable_reg = &cs47l15_16bit_readable_register,
 	.volatile_reg = &cs47l15_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l15_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l15_reg_default),
 };
@@ -1264,7 +1264,7 @@ const struct regmap_config cs47l15_16bit_i2c_regmap = {
 	.readable_reg = &cs47l15_16bit_readable_register,
 	.volatile_reg = &cs47l15_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l15_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l15_reg_default),
 };
@@ -1281,7 +1281,7 @@ const struct regmap_config cs47l15_32bit_spi_regmap = {
 	.readable_reg = &cs47l15_32bit_readable_register,
 	.volatile_reg = &cs47l15_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l15_32bit_spi_regmap);
 
@@ -1295,6 +1295,6 @@ const struct regmap_config cs47l15_32bit_i2c_regmap = {
 	.readable_reg = &cs47l15_32bit_readable_register,
 	.volatile_reg = &cs47l15_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l15_32bit_i2c_regmap);
Signature · 1 line
2.39.2
author
#2 lore raw

PATCH 2/11 mfd: cs47l24: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the cs47l24 driver to use the more modern data structure.

---
 drivers/mfd/cs47l24-tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/cs47l24-tables.c +1 -1
index c289d92a5c1d..878dfd298a17 100644
@@ -1616,7 +1616,7 @@ const struct regmap_config cs47l24_spi_regmap = {
 	.readable_reg = cs47l24_readable_register,
 	.volatile_reg = cs47l24_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l24_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l24_reg_default),
 };
Signature · 1 line
2.39.2
author
#3 lore raw

PATCH 3/11 mfd: cs47l35: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the cs47l35 driver to use the more modern data structure.

---
 drivers/mfd/cs47l35-tables.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/cs47l35-tables.c +4 -4
index a0bc6c5100d6..274f4b05850a 100644
@@ -1498,7 +1498,7 @@ const struct regmap_config cs47l35_16bit_spi_regmap = {
 	.readable_reg = cs47l35_16bit_readable_register,
 	.volatile_reg = cs47l35_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l35_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l35_reg_default),
 };
@@ -1515,7 +1515,7 @@ const struct regmap_config cs47l35_16bit_i2c_regmap = {
 	.readable_reg = cs47l35_16bit_readable_register,
 	.volatile_reg = cs47l35_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l35_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l35_reg_default),
 };
@@ -1534,7 +1534,7 @@ const struct regmap_config cs47l35_32bit_spi_regmap = {
 	.readable_reg = cs47l35_32bit_readable_register,
 	.volatile_reg = cs47l35_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l35_32bit_spi_regmap);
 
@@ -1550,6 +1550,6 @@ const struct regmap_config cs47l35_32bit_i2c_regmap = {
 	.readable_reg = cs47l35_32bit_readable_register,
 	.volatile_reg = cs47l35_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l35_32bit_i2c_regmap);
Signature · 1 line
2.39.2
author
#4 lore raw

PATCH 4/11 mfd: cs47l85: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the cs47l85 driver to use the more modern data structure.

---
 drivers/mfd/cs47l85-tables.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/cs47l85-tables.c +4 -4
index 270d8eda3f5f..f397894827ce 100644
@@ -2836,7 +2836,7 @@ const struct regmap_config cs47l85_16bit_spi_regmap = {
 	.readable_reg = cs47l85_16bit_readable_register,
 	.volatile_reg = cs47l85_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l85_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l85_reg_default),
 };
@@ -2853,7 +2853,7 @@ const struct regmap_config cs47l85_16bit_i2c_regmap = {
 	.readable_reg = cs47l85_16bit_readable_register,
 	.volatile_reg = cs47l85_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l85_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l85_reg_default),
 };
@@ -2872,7 +2872,7 @@ const struct regmap_config cs47l85_32bit_spi_regmap = {
 	.readable_reg = cs47l85_32bit_readable_register,
 	.volatile_reg = cs47l85_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l85_32bit_spi_regmap);
 
@@ -2888,6 +2888,6 @@ const struct regmap_config cs47l85_32bit_i2c_regmap = {
 	.readable_reg = cs47l85_32bit_readable_register,
 	.volatile_reg = cs47l85_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l85_32bit_i2c_regmap);
Signature · 1 line
2.39.2
author
#5 lore raw

PATCH 5/11 mfd: cs47l90: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the cs47l90 driver to use the more modern data structure.

---
 drivers/mfd/cs47l90-tables.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/cs47l90-tables.c +4 -4
index 7345fc09c0bb..6f9ceb36c533 100644
@@ -2539,7 +2539,7 @@ const struct regmap_config cs47l90_16bit_spi_regmap = {
 	.readable_reg = cs47l90_16bit_readable_register,
 	.volatile_reg = cs47l90_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l90_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l90_reg_default),
 };
@@ -2556,7 +2556,7 @@ const struct regmap_config cs47l90_16bit_i2c_regmap = {
 	.readable_reg = cs47l90_16bit_readable_register,
 	.volatile_reg = cs47l90_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l90_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l90_reg_default),
 };
@@ -2575,7 +2575,7 @@ const struct regmap_config cs47l90_32bit_spi_regmap = {
 	.readable_reg = cs47l90_32bit_readable_register,
 	.volatile_reg = cs47l90_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l90_32bit_spi_regmap);
 
@@ -2591,6 +2591,6 @@ const struct regmap_config cs47l90_32bit_i2c_regmap = {
 	.readable_reg = cs47l90_32bit_readable_register,
 	.volatile_reg = cs47l90_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l90_32bit_i2c_regmap);
Signature · 1 line
2.39.2
author
#6 lore raw

PATCH 6/11 mfd: cs47l92: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the cs47l92 driver to use the more modern data structure.

---
 drivers/mfd/cs47l92-tables.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/cs47l92-tables.c +4 -4
index f296e355df4d..4d9ba865aaf6 100644
@@ -1890,7 +1890,7 @@ const struct regmap_config cs47l92_16bit_spi_regmap = {
 	.readable_reg = &cs47l92_16bit_readable_register,
 	.volatile_reg = &cs47l92_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l92_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l92_reg_default),
 };
@@ -1907,7 +1907,7 @@ const struct regmap_config cs47l92_16bit_i2c_regmap = {
 	.readable_reg = &cs47l92_16bit_readable_register,
 	.volatile_reg = &cs47l92_16bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = cs47l92_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(cs47l92_reg_default),
 };
@@ -1926,7 +1926,7 @@ const struct regmap_config cs47l92_32bit_spi_regmap = {
 	.readable_reg = &cs47l92_32bit_readable_register,
 	.volatile_reg = &cs47l92_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l92_32bit_spi_regmap);
 
@@ -1942,6 +1942,6 @@ const struct regmap_config cs47l92_32bit_i2c_regmap = {
 	.readable_reg = &cs47l92_32bit_readable_register,
 	.volatile_reg = &cs47l92_32bit_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 };
 EXPORT_SYMBOL_GPL(cs47l92_32bit_i2c_regmap);
Signature · 1 line
2.39.2
author
#7 lore raw

PATCH 7/11 mfd: wm5102: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the wm5102 driver to use the more modern data structure.

---
 drivers/mfd/wm5102-tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/wm5102-tables.c +1 -1
index 6bba39657991..f77ecc635b6f 100644
@@ -1938,7 +1938,7 @@ const struct regmap_config wm5102_i2c_regmap = {
 	.readable_reg = wm5102_readable_register,
 	.volatile_reg = wm5102_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = wm5102_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(wm5102_reg_default),
 };
Signature · 1 line
2.39.2
author
#8 lore raw

PATCH 8/11 mfd: wm5110: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the wm5110 driver to use the more modern data structure.

---
 drivers/mfd/wm5110-tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/wm5110-tables.c +1 -1
index 65b9b1d6daec..eba324875afd 100644
@@ -3218,7 +3218,7 @@ const struct regmap_config wm5110_i2c_regmap = {
 	.readable_reg = wm5110_readable_register,
 	.volatile_reg = wm5110_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = wm5110_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(wm5110_reg_default),
 };
Signature · 1 line
2.39.2
maintainer
#9 lore raw

Re: [PATCH 08/11] mfd: wm5110: Update to use maple tree register cache

Quoted 31 lines · Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the wm5110 driver to use the more modern data structure.

---
 drivers/mfd/wm5110-tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/wm5110-tables.c +1 -1
index 65b9b1d6daec..eba324875afd 100644
@@ -3218,7 +3218,7 @@ const struct regmap_config wm5110_i2c_regmap = {
 	.readable_reg = wm5110_readable_register,
 	.volatile_reg = wm5110_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = wm5110_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(wm5110_reg_default),
 };
Signature · 2 lines
-- 
2.39.2

This one appears to cause me some issues, seems to get the IRQs into a weird state when doing compressed stream stuff. The issue seems to also require commit bfa0b38c1483 ("regmap:
maple: Implement block sync for the maple tree cache") to be present. So it definitely seems to relate to the cache sync, but not sure if it is something todo with the device itself, or the maple tree stuff yet.

Thanks,
Charles

maintainer
#10 lore raw

Re: [PATCH 08/11] mfd: wm5110: Update to use maple tree register cache

Quoted 29 lines · Charles Keepax
Quoted 28 lines · Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the wm5110 driver to use the more modern data structure.

---
 drivers/mfd/wm5110-tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/wm5110-tables.c +1 -1
index 65b9b1d6daec..eba324875afd 100644
@@ -3218,7 +3218,7 @@ const struct regmap_config wm5110_i2c_regmap = {
 	.readable_reg = wm5110_readable_register,
 	.volatile_reg = wm5110_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = wm5110_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(wm5110_reg_default),
 };
Quoted 12 lines
Quoted 3 lines
Signature · 1 line
2.39.2

This one appears to cause me some issues, seems to get the IRQs into a weird state when doing compressed stream stuff. The issue seems to also require commit bfa0b38c1483 ("regmap:
maple: Implement block sync for the maple tree cache") to be present. So it definitely seems to relate to the cache sync, but not sure if it is something todo with the device itself, or the maple tree stuff yet.

Ah... I think I see the regcache_sync sets async=true, but then the maple tree code immediately deletes the buffer after calling _regmap_raw_write. So its a racy use after free.

How would we feel about having the maple tree code, clear async again?

Thanks,
Charles

author
#11 lore raw

Re: [PATCH 08/11] mfd: wm5110: Update to use maple tree register cache

Quoted 10 lines · Charles Keepax
Quoted 7 lines · Charles Keepax

This one appears to cause me some issues, seems to get the IRQs into a weird state when doing compressed stream stuff. The issue seems to also require commit bfa0b38c1483 ("regmap:
maple: Implement block sync for the maple tree cache") to be present. So it definitely seems to relate to the cache sync, but not sure if it is something todo with the device itself, or the maple tree stuff yet.

Quoted 6 lines

Ah... I think I see the regcache_sync sets async=true, but then the maple tree code immediately deletes the buffer after calling _regmap_raw_write. So its a racy use after free.

How would we feel about having the maple tree code, clear async again?

I was going to say, it must be a maple tree issue. I think we should push that async down into the rbtree code, that's probably also broken for other cache types if used in conjunction with slow buses...

author
#12 lore raw

PATCH 9/11 mfd: wm8994: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the wm8994 driver to use the more modern data structure.

---
 drivers/mfd/wm8994-regmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mfd/wm8994-regmap.c +3 -3
index cd4fef7df336..ee2ed6773afd 100644
@@ -1238,7 +1238,7 @@ struct regmap_config wm1811_regmap_config = {
 	.reg_bits = 16,
 	.val_bits = 16,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 
 	.reg_defaults = wm1811_defaults,
 	.num_reg_defaults = ARRAY_SIZE(wm1811_defaults),
@@ -1253,7 +1253,7 @@ struct regmap_config wm8994_regmap_config = {
 	.reg_bits = 16,
 	.val_bits = 16,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 
 	.reg_defaults = wm8994_defaults,
 	.num_reg_defaults = ARRAY_SIZE(wm8994_defaults),
@@ -1268,7 +1268,7 @@ struct regmap_config wm8958_regmap_config = {
 	.reg_bits = 16,
 	.val_bits = 16,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 
 	.reg_defaults = wm8958_defaults,
 	.num_reg_defaults = ARRAY_SIZE(wm8958_defaults),
Signature · 1 line
2.39.2
author
#13 lore raw

PATCH 10/11 mfd: wm8997: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the wm8997 driver to use the more modern data structure.

---
 drivers/mfd/wm8997-tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/wm8997-tables.c +1 -1
index 3476787c485e..288c57b2d21e 100644
@@ -1523,7 +1523,7 @@ const struct regmap_config wm8997_i2c_regmap = {
 	.readable_reg = wm8997_readable_register,
 	.volatile_reg = wm8997_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = wm8997_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(wm8997_reg_default),
 };
Signature · 1 line
2.39.2
author
#14 lore raw

PATCH 11/11 mfd: wm8998: Update to use maple tree register cache

In reply to Mark Brown

The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there.

Update the wm8998 driver to use the more modern data structure.

---
 drivers/mfd/wm8998-tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/wm8998-tables.c +1 -1
index 9b34a6d76094..b3e6e85bee89 100644
@@ -1556,7 +1556,7 @@ const struct regmap_config wm8998_i2c_regmap = {
 	.readable_reg = wm8998_readable_register,
 	.volatile_reg = wm8998_volatile_register,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.reg_defaults = wm8998_reg_default,
 	.num_reg_defaults = ARRAY_SIZE(wm8998_reg_default),
 };
Signature · 1 line
2.39.2
maintainer Applied
#15 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown

With the v6.5 merge window the maple tree register cache has acquired the ability to generate multi-register writes during sync operations, removing the last major limitation it had compared to the rbtree cache. As part of a general modernisation effort update the Cirrus Logic drivers to use the more modern data structure, realistically there is likely to be very little user visible impact either way but generally the implementation choices of the maple tree cache should be a bit better on modern hardware.

[...]

Applied, thanks!

[01/11] mfd: cs47l15: Update to use maple tree register cache

        commit: b4dcbfa82d1264f7c813b6fa4cdc63851daa9b86
[02/11] mfd: cs47l24: Update to use maple tree register cache
        commit: 7814d7e4eac9ad7f87dd1a670feadd9caafd3713
[03/11] mfd: cs47l35: Update to use maple tree register cache
        commit: 1ae7edc5cb666d6d382263d50d9a48cb8a6898e9
[04/11] mfd: cs47l85: Update to use maple tree register cache
        commit: e7c8dce6e5dc3f9963bc9762278f8db33770db95
[05/11] mfd: cs47l90: Update to use maple tree register cache
        commit: 703458beace3c8530808371398dd147339f31c71
[06/11] mfd: cs47l92: Update to use maple tree register cache
        commit: 5b6b74f62046d44269d3720fdfe5cc482392b99e
[07/11] mfd: wm5102: Update to use maple tree register cache
        commit: d635f7d7f1be3160291d22cb05148259c9fdfafd
[08/11] mfd: wm5110: Update to use maple tree register cache
        commit: aad8ec37d158a35c2397a76964f9541fe3fd59b6
[09/11] mfd: wm8994: Update to use maple tree register cache
        commit: 03665778ce02e9bf95ef18f2548cb6dfca01a347
[10/11] mfd: wm8997: Update to use maple tree register cache
        commit: 8e3c1052f4fb404f7264059e706807de43f68a23
[11/11] mfd: wm8998: Update to use maple tree register cache
        commit: 0d606d3545727c1399bd61b1340dde84e900178f

Best regards,

Signature · 1 line
Lee Jones <[email protected]>