[PATCH v9 11/21] ARM64 / ACPI: Get PSCI flags in FADT for PSCI init
From: Olof Johansson <hidden>
Date: 2015-03-05 18:18:59
Also in:
linux-acpi, lkml
Hi, On Wed, Feb 25, 2015 at 04:39:51PM +0800, Hanjun Guo wrote:
From: Graeme Gregory <redacted> There are two flags: PSCI_COMPLIANT and PSCI_USE_HVC. When set, the former signals to the OS that the firmware is PSCI compliant. The latter selects the appropriate conduit for PSCI calls by toggling between Hypervisor Calls (HVC) and Secure Monitor Calls (SMC). FADT table contains such information in ACPI 5.1, FADT table was parsed in ACPI table init and copy to struct acpi_gbl_FADT, so use the flags in struct acpi_gbl_FADT for PSCI init. Since ACPI 5.1 doesn't support self defined PSCI function IDs, which means that only PSCI 0.2+ is supported in ACPI. CC: Lorenzo Pieralisi <redacted> CC: Catalin Marinas <catalin.marinas@arm.com> CC: Will Deacon <redacted> Tested-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> Tested-by: Yijing Wang <redacted> Tested-by: Mark Langsdorf <redacted> Tested-by: Jon Masters <redacted> Tested-by: Timur Tabi <redacted> Tested-by: Robert Richter <redacted> Acked-by: Robert Richter <redacted> Signed-off-by: Graeme Gregory <redacted> Signed-off-by: Tomasz Nowicki <redacted> Signed-off-by: Hanjun Guo <redacted>
Acked-by: Olof Johansson <redacted> However, a comment on the color of the bike shed below. I'm fine with this being addressed with an incremental patch instead of respun:
quoted hunk ↗ jump to hunk
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index e8c7000..97fa7f3 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c@@ -390,10 +390,12 @@ void __init setup_arch(char **cmdline_p) early_ioremap_reset(); - if (acpi_disabled) + if (acpi_disabled) { unflatten_device_tree(); - - psci_init(); + psci_dt_init(); + } else { + psci_acpi_init(); + }
I would prefer having a common psci_init() in psci.c, which in turn calls either the dt or the acpi version, and after that calls the set_functions if the init function passed -- it'll keep more code common as new versions of PSCI is added. It also keeps setup_arch() somewhat cleaner, and avoids bubbling up the dt-vs-acpi differences to the top level. -Olof