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

Conor Dooley
2023-02-08T20:58:57Z

[-- Attachment #1.1: Type: text/plain, Size: 1686 bytes --]

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()?

> + * 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.

> + goto done;
> + /*

A small nit: a newline before opening the comment block here please!

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]