]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM64: kernel: acpi: honour acpi=force command line parameter
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 25 Mar 2015 15:22:13 +0000 (15:22 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 26 Mar 2015 15:13:11 +0000 (15:13 +0000)
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>
arch/arm64/include/asm/acpi.h
arch/arm64/kernel/acpi.c
arch/arm64/kernel/setup.c

index e1a89656f17e039d7924fd1ca1bc926183afc7ac..59c05d8ea4a000fc9ae4d5cb47bff84ff9c4262f 100644 (file)
@@ -38,7 +38,6 @@ typedef u64 phys_cpuid_t;
 extern int acpi_disabled;
 extern int acpi_noirq;
 extern int acpi_pci_disabled;
-extern bool param_acpi_force;
 
 /* 1 to indicate PSCI 0.2+ is implemented */
 static inline bool acpi_psci_present(void)
@@ -92,8 +91,6 @@ void __init acpi_init_cpus(void);
 static inline bool acpi_psci_present(void) { return false; }
 static inline bool acpi_psci_use_hvc(void) { return false; }
 static inline void acpi_init_cpus(void) { }
-
-#define param_acpi_force false
 #endif /* CONFIG_ACPI */
 
 #endif /*_ASM_ACPI_H*/
index 172b7c9f6881c6767a54f437b9291fc134e7cb0a..cd60329da8c41c474d48e2eaa96927ce15704d06 100644 (file)
@@ -43,7 +43,7 @@ static int enabled_cpus;
 static bool bootcpu_valid  __initdata;
 
 static bool param_acpi_off __initdata;
-bool param_acpi_force __initdata;
+static bool param_acpi_force __initdata;
 
 static int __init parse_acpi(char *arg)
 {
@@ -284,8 +284,13 @@ out:
  * We can parse ACPI boot-time tables such as MADT after
  * this function is called.
  *
- * ACPI is enabled on return if ACPI tables initialized and sanity checks
- * passed, disabled otherwise
+ * On return ACPI is enabled if either:
+ *
+ * - ACPI tables are initialized and sanity checks passed
+ * - acpi=force was passed in the command line and ACPI was not disabled
+ *   explicitly through acpi=off command line parameter
+ *
+ * ACPI is disabled on function return otherwise
  */
 void __init acpi_boot_table_init(void)
 {
@@ -309,10 +314,13 @@ void __init acpi_boot_table_init(void)
         * If ACPI tables are initialized and FADT sanity checks passed,
         * leave ACPI enabled and carry on booting; otherwise disable ACPI
         * on initialization error.
+        * If acpi=force was passed on the command line it forces ACPI
+        * to be enabled even if its initialization failed.
         */
        if (acpi_table_init() || acpi_fadt_sanity_check()) {
                pr_err("Failed to init ACPI tables\n");
-               disable_acpi();
+               if (!param_acpi_force)
+                       disable_acpi();
        }
 }
 
index d60b1adc75004f449fb5a406155f5a99ad63a475..b2783111fd52b1e213b1be43ec5c0742bf020921 100644 (file)
@@ -390,7 +390,7 @@ void __init setup_arch(char **cmdline_p)
 
        early_ioremap_reset();
 
-       if (acpi_disabled  && !param_acpi_force) {
+       if (acpi_disabled) {
                unflatten_device_tree();
                psci_dt_init();
                cpu_read_bootcpu_ops();