aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2015-03-25 11:22:13 -0400
committerWill Deacon <will.deacon@arm.com>2015-03-26 11:13:11 -0400
commitfb094eb19900937322848beaf1a622c6afb6250b (patch)
tree102d75fcef8fa67090c2a84dacf67aee60a626ff
parent54971e43b9d6cb37366d2da64cc5a2d8f8102bc4 (diff)
ARM64: kernel: acpi: honour acpi=force command line parameter
If acpi=force is passed on the command line, it forces ACPI to be the only available boot method, hence it must be left enabled even if the initialization and sanity checks on ACPI tables fails. This patch refactors ACPI initialization to prevent disabling ACPI if acpi=force is passed on the command line. Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Hanjun Guo <hanjun.guo@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Hanjun Guo <hanjun.guo@linaro.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm64/include/asm/acpi.h3
-rw-r--r--arch/arm64/kernel/acpi.c16
-rw-r--r--arch/arm64/kernel/setup.c2
3 files changed, 13 insertions, 8 deletions
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index e1a89656f17e..59c05d8ea4a0 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -38,7 +38,6 @@ typedef u64 phys_cpuid_t;
38extern int acpi_disabled; 38extern int acpi_disabled;
39extern int acpi_noirq; 39extern int acpi_noirq;
40extern int acpi_pci_disabled; 40extern int acpi_pci_disabled;
41extern bool param_acpi_force;
42 41
43/* 1 to indicate PSCI 0.2+ is implemented */ 42/* 1 to indicate PSCI 0.2+ is implemented */
44static inline bool acpi_psci_present(void) 43static inline bool acpi_psci_present(void)
@@ -92,8 +91,6 @@ void __init acpi_init_cpus(void);
92static inline bool acpi_psci_present(void) { return false; } 91static inline bool acpi_psci_present(void) { return false; }
93static inline bool acpi_psci_use_hvc(void) { return false; } 92static inline bool acpi_psci_use_hvc(void) { return false; }
94static inline void acpi_init_cpus(void) { } 93static inline void acpi_init_cpus(void) { }
95
96#define param_acpi_force false
97#endif /* CONFIG_ACPI */ 94#endif /* CONFIG_ACPI */
98 95
99#endif /*_ASM_ACPI_H*/ 96#endif /*_ASM_ACPI_H*/
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 172b7c9f6881..cd60329da8c4 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -43,7 +43,7 @@ static int enabled_cpus;
43static bool bootcpu_valid __initdata; 43static bool bootcpu_valid __initdata;
44 44
45static bool param_acpi_off __initdata; 45static bool param_acpi_off __initdata;
46bool param_acpi_force __initdata; 46static bool param_acpi_force __initdata;
47 47
48static int __init parse_acpi(char *arg) 48static int __init parse_acpi(char *arg)
49{ 49{
@@ -284,8 +284,13 @@ out:
284 * We can parse ACPI boot-time tables such as MADT after 284 * We can parse ACPI boot-time tables such as MADT after
285 * this function is called. 285 * this function is called.
286 * 286 *
287 * ACPI is enabled on return if ACPI tables initialized and sanity checks 287 * On return ACPI is enabled if either:
288 * passed, disabled otherwise 288 *
289 * - ACPI tables are initialized and sanity checks passed
290 * - acpi=force was passed in the command line and ACPI was not disabled
291 * explicitly through acpi=off command line parameter
292 *
293 * ACPI is disabled on function return otherwise
289 */ 294 */
290void __init acpi_boot_table_init(void) 295void __init acpi_boot_table_init(void)
291{ 296{
@@ -309,10 +314,13 @@ void __init acpi_boot_table_init(void)
309 * If ACPI tables are initialized and FADT sanity checks passed, 314 * If ACPI tables are initialized and FADT sanity checks passed,
310 * leave ACPI enabled and carry on booting; otherwise disable ACPI 315 * leave ACPI enabled and carry on booting; otherwise disable ACPI
311 * on initialization error. 316 * on initialization error.
317 * If acpi=force was passed on the command line it forces ACPI
318 * to be enabled even if its initialization failed.
312 */ 319 */
313 if (acpi_table_init() || acpi_fadt_sanity_check()) { 320 if (acpi_table_init() || acpi_fadt_sanity_check()) {
314 pr_err("Failed to init ACPI tables\n"); 321 pr_err("Failed to init ACPI tables\n");
315 disable_acpi(); 322 if (!param_acpi_force)
323 disable_acpi();
316 } 324 }
317} 325}
318 326
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index d60b1adc7500..b2783111fd52 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -390,7 +390,7 @@ void __init setup_arch(char **cmdline_p)
390 390
391 early_ioremap_reset(); 391 early_ioremap_reset();
392 392
393 if (acpi_disabled && !param_acpi_force) { 393 if (acpi_disabled) {
394 unflatten_device_tree(); 394 unflatten_device_tree();
395 psci_dt_init(); 395 psci_dt_init();
396 cpu_read_bootcpu_ops(); 396 cpu_read_bootcpu_ops();