[PATCH V3 11/20] RISC-V: ACPI: Cache and retrieve the RINTC structure
Conor Dooley
conor at kernel.org
Fri Mar 3 08:58:53 PST 2023
On Fri, Mar 03, 2023 at 05:05:56PM +0100, Andrew Jones wrote:
> On Fri, Mar 03, 2023 at 07:06:38PM +0530, Sunil V L wrote:
> > RINTC structures in the MADT provide mapping between the hartid
> > and the CPU. This is required many times even at run time like
> > cpuinfo. So, instead of parsing the ACPI table every time, cache
> > the RINTC structures and provide a function to get the correct
> > RINTC structure for a given cpu.
> >
> > Signed-off-by: Sunil V L <sunilvl at ventanamicro.com>
> > Acked-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
> > ---
> > arch/riscv/include/asm/acpi.h | 9 ++++++
> > arch/riscv/kernel/acpi.c | 56 +++++++++++++++++++++++++++++++++++
> > 2 files changed, 65 insertions(+)
> > diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h
> > index 111a8ed10af1..8be16c1ef7da 100644
> > --- a/arch/riscv/include/asm/acpi.h
> > +++ b/arch/riscv/include/asm/acpi.h
> > @@ -61,6 +61,10 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) { }
> >
> > int acpi_get_riscv_isa(struct acpi_table_header *table,
> > unsigned int cpu, const char **isa);
> > +
> > +struct acpi_madt_rintc *acpi_cpu_get_madt_rintc(int cpu);
> > +
> > +u32 get_acpi_id_for_cpu(int cpu);
> > #else
> > static inline int acpi_get_riscv_isa(struct acpi_table_header *table,
> > unsigned int cpu, const char **isa)
> > @@ -68,6 +72,11 @@ static inline int acpi_get_riscv_isa(struct acpi_table_header *table,
> > return -EINVAL;
> > }
> >
> > +static inline u32 get_acpi_id_for_cpu(int cpu)
> > +{
> > + return -1;
> > +}
>
> Why do we need this stub? I wouldn't expect non-ACPI code to need an ACPI
> ID.
I think I asked for this (or assumed it existed) in v1, when I requested
the removal of #ifdef CONFIG_ACPI stuff in riscv_fill_hwcap().
Personally, I'd rather have this stub than the ifdeffery :)
Cheers,
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230303/72f317cd/attachment.sig>
More information about the linux-riscv
mailing list