public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: wm831x: Use maple tree register cache
@ 2023-04-25 18:03 Mark Brown
  2023-04-27  9:46 ` Charles Keepax
  2023-04-27 15:11 ` Lee Jones
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2023-04-25 18:03 UTC (permalink / raw)
  To: Lee Jones; +Cc: patches, linux-kernel, 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/mfd/wm831x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index d2f444d2ae78..e86b6a4896a6 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -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,
-- 
Mark Brown <broonie@kernel.org>


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

* Re: [PATCH] mfd: wm831x: Use maple tree register cache
  2023-04-25 18:03 [PATCH] mfd: wm831x: Use maple tree register cache Mark Brown
@ 2023-04-27  9:46 ` Charles Keepax
  2023-04-27 15:11 ` Lee Jones
  1 sibling, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2023-04-27  9:46 UTC (permalink / raw)
  To: Mark Brown; +Cc: Lee Jones, patches, linux-kernel

On Tue, Apr 25, 2023 at 07:03:33PM +0100, Mark Brown wrote:
> 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.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH] mfd: wm831x: Use maple tree register cache
  2023-04-25 18:03 [PATCH] mfd: wm831x: Use maple tree register cache Mark Brown
  2023-04-27  9:46 ` Charles Keepax
@ 2023-04-27 15:11 ` Lee Jones
  2023-04-27 15:15   ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Lee Jones @ 2023-04-27 15:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: patches, linux-kernel

On Tue, 25 Apr 2023, Mark Brown wrote:

> 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.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  drivers/mfd/wm831x-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH] mfd: wm831x: Use maple tree register cache
  2023-04-27 15:11 ` Lee Jones
@ 2023-04-27 15:15   ` Mark Brown
  2023-04-27 16:28     ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2023-04-27 15:15 UTC (permalink / raw)
  To: Lee Jones; +Cc: patches, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On Thu, Apr 27, 2023 at 04:11:34PM +0100, Lee Jones wrote:
> On Tue, 25 Apr 2023, Mark Brown wrote:
> 
> > 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] mfd: wm831x: Use maple tree register cache
  2023-04-27 15:15   ` Mark Brown
@ 2023-04-27 16:28     ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2023-04-27 16:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: patches, linux-kernel

On Thu, 27 Apr 2023, Mark Brown wrote:

> On Thu, Apr 27, 2023 at 04:11:34PM +0100, Lee Jones wrote:
> > On Tue, 25 Apr 2023, Mark Brown wrote:
> > 
> > > 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.

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.

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-04-27 16:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 18:03 [PATCH] mfd: wm831x: Use maple tree register cache Mark Brown
2023-04-27  9:46 ` Charles Keepax
2023-04-27 15:11 ` Lee Jones
2023-04-27 15:15   ` Mark Brown
2023-04-27 16:28     ` Lee Jones

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