Skip to contentSkip to conversation

mfd: wm831x: Use maple tree register cache

PATCH Applied Mark Brown 3 participants 5 messages Apr 25, 2023 – Apr 27, 2023

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 mfd: wm831x: Use maple tree register cache

regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do not grow to such depths when the register map is sparse which makes access a bit more efficient. The maple tree cache type is still a bit of a work in progress but should be effective for some devices already.

The wm831x devices have a pretty sparse register map and being always on devices never do cache syncs so don't hit the major current disadvantage so they should be good candiates for using the maple tree cache. Update to do so, there should be little if any visible difference at runtime.

---
 drivers/mfd/wm831x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/wm831x-core.c +1 -1
index d2f444d2ae78..e86b6a4896a6 100644
@@ -1430,7 +1430,7 @@ struct regmap_config wm831x_regmap_config = {
 	.reg_bits = 16,
 	.val_bits = 16,
 
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 
 	.max_register = WM831X_DBE_CHECK_DATA,
 	.readable_reg = wm831x_reg_readable,

---
base-commit: 4a670ac3e75e517c96cbd01ef870dbd598c3ce71
change-id: 20230419-mfd-wm831x-maple-8da691bc3efc

Best regards,

Signature · 1 line
Mark Brown <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mark Brown

regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do not grow to such depths when the register map is sparse which makes access a bit more efficient. The maple tree cache type is still a bit of a work in progress but should be effective for some devices already.

Quoted 7 lines

The wm831x devices have a pretty sparse register map and being always on devices never do cache syncs so don't hit the major current disadvantage so they should be good candiates for using the maple tree cache. Update to do so, there should be little if any visible difference at runtime.

---

Thanks,
Charles

maintainer Applied
#2 lore raw
In reply to Mark Brown
Quoted 12 lines · Mark Brown

regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do not grow to such depths when the register map is sparse which makes access a bit more efficient. The maple tree cache type is still a bit of a work in progress but should be effective for some devices already.

The wm831x devices have a pretty sparse register map and being always on devices never do cache syncs so don't hit the major current disadvantage so they should be good candiates for using the maple tree cache. Update to do so, there should be little if any visible difference at runtime.

Quoted 4 lines
---
 drivers/mfd/wm831x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Signature · 1 line
Lee Jones [李琼斯]
author
#3 lore raw
Quoted 7 lines · Lee Jones
Quoted 3 lines · Mark Brown

regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do

Applied, thanks

Note that the maple tree support for regmap has only landed in Linus' tree during the current merge window, I wasn't anticipating this being applied until -rc1 due to it being sent after the merge window opened.

maintainer
#4 lore raw
Quoted 7 lines · Mark Brown
Quoted 5 lines · Lee Jones
Quoted 3 lines · Mark Brown

regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do

Quoted 5 lines
Quoted 1 line

Applied, thanks

Note that the maple tree support for regmap has only landed in Linus' tree during the current merge window, I wasn't anticipating this being applied until -rc1 due to it being sent after the merge window opened.

It's been applied to for-mfd-next-next which will become for-mfd-next *after* the merge-window closes. IOW, it's due for v6.5.

Signature · 1 line
Lee Jones [李琼斯]