All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] clk: versaclock: regmap modernisations
@ 2023-09-29 14:26 Mark Brown
  2023-09-29 14:26 ` [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable() Mark Brown
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Mark Brown @ 2023-09-29 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Luca Ceresoli, Alex Helms
  Cc: linux-clk, linux-kernel, Mark Brown

The maple tree register cache is a more modern replacement for the
rbtree cache which uses a more modern data structure and makes decisions
likely to be better for more current hardware, update the versaclock
drivers to use it.

While looking at updating the cache types I noticed a minor optimisation
opportunity with a redundant _is_writeable() operation in versaclock3 so
I updated that too.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
Mark Brown (4):
      clk: versaclock3: Remove redundant _is_writeable()
      clk: versaclock3: Convert to use maple tree register cache
      clk: versaclock5: Convert to use maple tree register cache
      clk: versaclock7: Convert to use maple tree register cache

 drivers/clk/clk-versaclock3.c | 8 +-------
 drivers/clk/clk-versaclock5.c | 2 +-
 drivers/clk/clk-versaclock7.c | 2 +-
 3 files changed, 3 insertions(+), 9 deletions(-)
---
base-commit: 6465e260f48790807eef06b583b38ca9789b6072
change-id: 20230929-clk-maple-versaclk-129fa4fb712f

Best regards,
-- 
Mark Brown <broonie@kernel.org>


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

* [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable()
  2023-09-29 14:26 [PATCH 0/4] clk: versaclock: regmap modernisations Mark Brown
@ 2023-09-29 14:26 ` Mark Brown
  2023-10-10  3:32   ` Stephen Boyd
  2023-09-29 14:26 ` [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache Mark Brown
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2023-09-29 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Luca Ceresoli, Alex Helms
  Cc: linux-clk, linux-kernel, Mark Brown

The versaclock3 driver provides an _is_writeable() function which returns
true for all registers. This is the default assumption for regmaps so we
can remove the function for a very minor improvement in performance and
code size.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/clk/clk-versaclock3.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c
index 7ab2447bd203..a5ab48ff242c 100644
--- a/drivers/clk/clk-versaclock3.c
+++ b/drivers/clk/clk-versaclock3.c
@@ -586,17 +586,11 @@ static const struct clk_ops vc3_clk_mux_ops = {
 	.get_parent = vc3_clk_mux_get_parent,
 };
 
-static bool vc3_regmap_is_writeable(struct device *dev, unsigned int reg)
-{
-	return true;
-}
-
 static const struct regmap_config vc3_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.cache_type = REGCACHE_RBTREE,
 	.max_register = 0x24,
-	.writeable_reg = vc3_regmap_is_writeable,
 };
 
 static struct vc3_hw_data clk_div[5];

-- 
2.39.2


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

* [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache
  2023-09-29 14:26 [PATCH 0/4] clk: versaclock: regmap modernisations Mark Brown
  2023-09-29 14:26 ` [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable() Mark Brown
@ 2023-09-29 14:26 ` Mark Brown
  2023-10-10  3:32   ` Stephen Boyd
  2023-09-29 14:26 ` [PATCH 3/4] clk: versaclock5: " Mark Brown
  2023-09-29 14:26 ` [PATCH 4/4] clk: versaclock7: " Mark Brown
  3 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2023-09-29 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Luca Ceresoli, Alex Helms
  Cc: linux-clk, linux-kernel, 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.

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

diff --git a/drivers/clk/clk-versaclock3.c b/drivers/clk/clk-versaclock3.c
index a5ab48ff242c..b4a89c083c11 100644
--- a/drivers/clk/clk-versaclock3.c
+++ b/drivers/clk/clk-versaclock3.c
@@ -589,7 +589,7 @@ static const struct clk_ops vc3_clk_mux_ops = {
 static const struct regmap_config vc3_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.max_register = 0x24,
 };
 

-- 
2.39.2


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

* [PATCH 3/4] clk: versaclock5: Convert to use maple tree register cache
  2023-09-29 14:26 [PATCH 0/4] clk: versaclock: regmap modernisations Mark Brown
  2023-09-29 14:26 ` [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable() Mark Brown
  2023-09-29 14:26 ` [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache Mark Brown
@ 2023-09-29 14:26 ` Mark Brown
  2023-10-10  3:32   ` Stephen Boyd
  2023-09-29 14:26 ` [PATCH 4/4] clk: versaclock7: " Mark Brown
  3 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2023-09-29 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Luca Ceresoli, Alex Helms
  Cc: linux-clk, linux-kernel, 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.

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

diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
index 17cbb30d20ad..6d31cd54d7cf 100644
--- a/drivers/clk/clk-versaclock5.c
+++ b/drivers/clk/clk-versaclock5.c
@@ -217,7 +217,7 @@ static bool vc5_regmap_is_writeable(struct device *dev, unsigned int reg)
 static const struct regmap_config vc5_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.max_register = 0x76,
 	.writeable_reg = vc5_regmap_is_writeable,
 };

-- 
2.39.2


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

* [PATCH 4/4] clk: versaclock7: Convert to use maple tree register cache
  2023-09-29 14:26 [PATCH 0/4] clk: versaclock: regmap modernisations Mark Brown
                   ` (2 preceding siblings ...)
  2023-09-29 14:26 ` [PATCH 3/4] clk: versaclock5: " Mark Brown
@ 2023-09-29 14:26 ` Mark Brown
  2023-10-10  3:31   ` Stephen Boyd
  3 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2023-09-29 14:26 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Luca Ceresoli, Alex Helms
  Cc: linux-clk, linux-kernel, 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.

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

diff --git a/drivers/clk/clk-versaclock7.c b/drivers/clk/clk-versaclock7.c
index 9ab35c1af0ff..f323263e32c3 100644
--- a/drivers/clk/clk-versaclock7.c
+++ b/drivers/clk/clk-versaclock7.c
@@ -1275,7 +1275,7 @@ static const struct regmap_config vc7_regmap_config = {
 	.ranges = vc7_range_cfg,
 	.num_ranges = ARRAY_SIZE(vc7_range_cfg),
 	.volatile_reg = vc7_volatile_reg,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.can_multi_write = true,
 	.reg_format_endian = REGMAP_ENDIAN_LITTLE,
 	.val_format_endian = REGMAP_ENDIAN_LITTLE,

-- 
2.39.2


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

* Re: [PATCH 4/4] clk: versaclock7: Convert to use maple tree register cache
  2023-09-29 14:26 ` [PATCH 4/4] clk: versaclock7: " Mark Brown
@ 2023-10-10  3:31   ` Stephen Boyd
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2023-10-10  3:31 UTC (permalink / raw)
  To: Alex Helms, Luca Ceresoli, Mark Brown, Michael Turquette
  Cc: linux-clk, linux-kernel, Mark Brown

Quoting Mark Brown (2023-09-29 07:26:08)
> 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.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Applied to clk-next

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

* Re: [PATCH 3/4] clk: versaclock5: Convert to use maple tree register cache
  2023-09-29 14:26 ` [PATCH 3/4] clk: versaclock5: " Mark Brown
@ 2023-10-10  3:32   ` Stephen Boyd
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2023-10-10  3:32 UTC (permalink / raw)
  To: Alex Helms, Luca Ceresoli, Mark Brown, Michael Turquette
  Cc: linux-clk, linux-kernel, Mark Brown

Quoting Mark Brown (2023-09-29 07:26:07)
> 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.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Applied to clk-next

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

* Re: [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache
  2023-09-29 14:26 ` [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache Mark Brown
@ 2023-10-10  3:32   ` Stephen Boyd
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2023-10-10  3:32 UTC (permalink / raw)
  To: Alex Helms, Luca Ceresoli, Mark Brown, Michael Turquette
  Cc: linux-clk, linux-kernel, Mark Brown

Quoting Mark Brown (2023-09-29 07:26:06)
> 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.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Applied to clk-next

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

* Re: [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable()
  2023-09-29 14:26 ` [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable() Mark Brown
@ 2023-10-10  3:32   ` Stephen Boyd
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2023-10-10  3:32 UTC (permalink / raw)
  To: Alex Helms, Luca Ceresoli, Mark Brown, Michael Turquette
  Cc: linux-clk, linux-kernel, Mark Brown

Quoting Mark Brown (2023-09-29 07:26:05)
> The versaclock3 driver provides an _is_writeable() function which returns
> true for all registers. This is the default assumption for regmaps so we
> can remove the function for a very minor improvement in performance and
> code size.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Applied to clk-next

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

end of thread, other threads:[~2023-10-10  3:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29 14:26 [PATCH 0/4] clk: versaclock: regmap modernisations Mark Brown
2023-09-29 14:26 ` [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable() Mark Brown
2023-10-10  3:32   ` Stephen Boyd
2023-09-29 14:26 ` [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache Mark Brown
2023-10-10  3:32   ` Stephen Boyd
2023-09-29 14:26 ` [PATCH 3/4] clk: versaclock5: " Mark Brown
2023-10-10  3:32   ` Stephen Boyd
2023-09-29 14:26 ` [PATCH 4/4] clk: versaclock7: " Mark Brown
2023-10-10  3:31   ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.