2024-01-29 08:00:58

by Sia Jee Heng

[permalink] [raw]
Subject: [RFC v1 0/2] riscv: Cache Population Code Refactoring for ACPI and DT Support

This series of patches refactors the cache population function to
seamlessly accommodate both DT and ACPI-based platforms. Additionally,
to streamline the code, the unused parameter in the ci_leaf_init()
function has been removed.

Sia Jee Heng (2):
riscv: cacheinfo: Remove unused parameter
riscv: cacheinfo: Refactor populate_cache_leaves()

arch/riscv/kernel/cacheinfo.c | 50 ++++++++++++++---------------------
1 file changed, 20 insertions(+), 30 deletions(-)


base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
--
2.34.1



2024-01-29 08:02:23

by Sia Jee Heng

[permalink] [raw]
Subject: [RFC v1 1/2] riscv: cacheinfo: Remove unused parameter

Removing the unused parameter in ci_leaf_init() to simplify the code.

Signed-off-by: Sia Jee Heng <[email protected]>
---
arch/riscv/kernel/cacheinfo.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
index 09e9b88110d1..30a6878287ad 100644
--- a/arch/riscv/kernel/cacheinfo.c
+++ b/arch/riscv/kernel/cacheinfo.c
@@ -64,7 +64,6 @@ uintptr_t get_cache_geometry(u32 level, enum cache_type type)
}

static void ci_leaf_init(struct cacheinfo *this_leaf,
- struct device_node *node,
enum cache_type type, unsigned int level)
{
this_leaf->level = level;
@@ -80,11 +79,11 @@ int populate_cache_leaves(unsigned int cpu)
int levels = 1, level = 1;

if (of_property_read_bool(np, "cache-size"))
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_UNIFIED, level);
+ ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
if (of_property_read_bool(np, "i-cache-size"))
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_INST, level);
+ ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
if (of_property_read_bool(np, "d-cache-size"))
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_DATA, level);
+ ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);

prev = np;
while ((np = of_find_next_cache_node(np))) {
@@ -97,11 +96,11 @@ int populate_cache_leaves(unsigned int cpu)
if (level <= levels)
break;
if (of_property_read_bool(np, "cache-size"))
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_UNIFIED, level);
+ ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
if (of_property_read_bool(np, "i-cache-size"))
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_INST, level);
+ ci_leaf_init(this_leaf++, CACHE_TYPE_INST, level);
if (of_property_read_bool(np, "d-cache-size"))
- ci_leaf_init(this_leaf++, np, CACHE_TYPE_DATA, level);
+ ci_leaf_init(this_leaf++, CACHE_TYPE_DATA, level);
levels = level;
}
of_node_put(np);
--
2.34.1


2024-01-29 11:56:56

by Conor Dooley

[permalink] [raw]
Subject: Re: [RFC v1 0/2] riscv: Cache Population Code Refactoring for ACPI and DT Support

On Sun, Jan 28, 2024 at 11:59:55PM -0800, Sia Jee Heng wrote:
> This series of patches refactors the cache population function to
> seamlessly accommodate both DT and ACPI-based platforms. Additionally,
> to streamline the code, the unused parameter in the ci_leaf_init()
> function has been removed.

Why's this an RFC? I don't see any mention of why.

Thanks,
Conor.

>
> Sia Jee Heng (2):
> riscv: cacheinfo: Remove unused parameter
> riscv: cacheinfo: Refactor populate_cache_leaves()
>
> arch/riscv/kernel/cacheinfo.c | 50 ++++++++++++++---------------------
> 1 file changed, 20 insertions(+), 30 deletions(-)
>
>
> base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
> --
> 2.34.1
>
>
> _______________________________________________
> linux-riscv mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-riscv


Attachments:
(No filename) (905.00 B)
signature.asc (235.00 B)
Download all attachments

2024-01-30 05:09:53

by Sia Jee Heng

[permalink] [raw]
Subject: RE: [RFC v1 0/2] riscv: Cache Population Code Refactoring for ACPI and DT Support



> -----Original Message-----
> From: Conor Dooley <[email protected]>
> Sent: Monday, January 29, 2024 7:50 PM
> To: JeeHeng Sia <[email protected]>
> Cc: [email protected]; [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
> Subject: Re: [RFC v1 0/2] riscv: Cache Population Code Refactoring for ACPI and DT Support
>
> On Sun, Jan 28, 2024 at 11:59:55PM -0800, Sia Jee Heng wrote:
> > This series of patches refactors the cache population function to
> > seamlessly accommodate both DT and ACPI-based platforms. Additionally,
> > to streamline the code, the unused parameter in the ci_leaf_init()
> > function has been removed.
>
> Why's this an RFC? I don't see any mention of why.
My bad, I should have mentioned the reason in the cover letter.
Btw, the reason treating this as RFC patch is because I am seeking for more
opinions as it is the first try for riscv acpi based cacheinfo.
>
> Thanks,
> Conor.
>
> >
> > Sia Jee Heng (2):
> > riscv: cacheinfo: Remove unused parameter
> > riscv: cacheinfo: Refactor populate_cache_leaves()
> >
> > arch/riscv/kernel/cacheinfo.c | 50 ++++++++++++++---------------------
> > 1 file changed, 20 insertions(+), 30 deletions(-)
> >
> >
> > base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
> > --
> > 2.34.1
> >
> >
> > _______________________________________________
> > linux-riscv mailing list
> > [email protected]
> > http://lists.infradead.org/mailman/listinfo/linux-riscv