• Lorenzo Pieralisi's avatar
    ARM64: kernel: acpi: refactor ACPI tables init and checks · 54971e43
    Lorenzo Pieralisi authored
    Current ACPI init code on ARM64 relies on acpi_table_parse() API to
    check if the FADT is present and to carry out sanity checks on that.
    
    The handler passed to the acpi_table_parse() function and used to
    carry out the parsing on the requested table returns a value that is
    ignored by the acpi_table_parse() function, so it is not possible
    to propagate errors back to the acpi_table_parse() caller through
    the handler.
    
    This forces ARM64 ACPI init code to have disable_acpi() calls scattered
    all over the place that makes code unwieldy and not easy to follow.
    
    This patch refactors the ARM64 ACPI init code, by creating a
    self-contained function (ie acpi_fadt_sanity_check()) that carries
    out the required checks on FADT and returns an adequate return value
    to the caller. This allows creating a common error path that disables
    ACPI and makes code more readable and easy to parse and change were
    further checks FADT to be added in the future.
    Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Reviewed-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: Hanjun Guo <hanjun.guo@linaro.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    54971e43
acpi.c 8.5 KB