2023-09-29 14:29:23

by Mark Brown

[permalink] [raw]
Subject: [PATCH 0/4] clk: versaclock: regmap modernisations

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 <[email protected]>
---
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 <[email protected]>


2023-09-29 14:40:00

by Mark Brown

[permalink] [raw]
Subject: [PATCH 2/4] clk: versaclock3: Convert 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.

Signed-off-by: Mark Brown <[email protected]>
---
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

2023-09-29 14:40:46

by Mark Brown

[permalink] [raw]
Subject: [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable()

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 <[email protected]>
---
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

2023-09-29 15:28:02

by Mark Brown

[permalink] [raw]
Subject: [PATCH 3/4] clk: versaclock5: Convert 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.

Signed-off-by: Mark Brown <[email protected]>
---
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

2023-09-29 15:28:05

by Mark Brown

[permalink] [raw]
Subject: [PATCH 4/4] clk: versaclock7: Convert 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.

Signed-off-by: Mark Brown <[email protected]>
---
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

2023-10-10 03:32:00

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 4/4] clk: versaclock7: Convert to use maple tree register cache

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 <[email protected]>
> ---

Applied to clk-next

2023-10-10 03:32:24

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 3/4] clk: versaclock5: Convert to use maple tree register cache

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 <[email protected]>
> ---

Applied to clk-next

2023-10-10 03:32:32

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache

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 <[email protected]>
> ---

Applied to clk-next

2023-10-10 03:32:52

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable()

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 <[email protected]>
> ---

Applied to clk-next