Re: [PATCH 05/24] RISC-V: ACPI: Add basic functions to build ACPI core

Sunil V L
2023-02-13T15:17:18Z

On Wed, Feb 08, 2023 at 08:58:31PM +0000, Conor Dooley wrote:
> On Mon, Jan 30, 2023 at 11:52:06PM +0530, Sunil V L wrote:
> > Introduce acpi.c and its related header files to provide
> > fundamental needs of extern variables and functions for ACPI core.
> > - asm/acpi.h for arch specific variables and functions needed by
> > ACPI driver core;
> > - acpi.c - Add function to initialize ACPI tables.
> > - acpi.c for RISC-V related ACPI implementation for ACPI driver
> > core;
> >
> > Code is mostly leveraged from ARM64.
>
>
>
> > diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
>
> > + * __acpi_map_table() will be called before page_init(), so early_ioremap()
>
> rg "\bpage_init\("
> arch/riscv/kernel/acpi.c
> 54: * __acpi_map_table() will be called before page_init(), so early_ioremap()
>
> arch/arm64/kernel/acpi.c
> 86: * __acpi_map_table() will be called before page_init(), so early_ioremap()
>
> This function doesn't appear to exist, perhaps what you are looking for is
> paging_init()?
>
Yes, will update.

> > + * or early_memremap() should be called here to for ACPI table mapping.
> > + */
> > +void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size)
> > +{
> > + if (!size)
> > + return NULL;
> > +
> > + return early_memremap(phys, size);
> > +}
>
> > +void __init acpi_boot_table_init(void)
> > +{
> > + /*
> > + * Enable ACPI instead of device tree unless
> > + * - ACPI has been disabled explicitly (acpi=off), or
> > + * - firmware has not populated ACPI ptr in EFI system table
> > + */
> > +
> > + if (param_acpi_off || (efi.acpi20 == EFI_INVALID_TABLE_ADDR))
>
> There's an extraneous set of () around the second item here.
>
Okay.
> > + goto done;
> > + /*
>
> A small nit: a newline before opening the comment block here please!

Thanks, will fix these in the next revision.
-Sunil