]> exis.tech > repos - linux.git/blobdiff - arch/arm64/kernel/smp.c
Merge tag 'hwmon-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[linux.git] / arch / arm64 / kernel / smp.c
index d46022f7207540c260736f06b15ac69699f3fdb7..cdcdd160e5b69614b9688db502de766de1dc9b07 100644 (file)
@@ -535,23 +535,13 @@ void arch_unregister_cpu(int cpu)
 {
        acpi_handle acpi_handle = acpi_get_processor_handle(cpu);
        struct cpu *c = &per_cpu(cpu_devices, cpu);
-       acpi_status status;
        unsigned long long sta;
-
-       if (!acpi_handle) {
-               pr_err_once("Removing a CPU without associated ACPI handle\n");
-               return;
-       }
+       acpi_status status;
 
        status = acpi_evaluate_integer(acpi_handle, "_STA", NULL, &sta);
-       if (ACPI_FAILURE(status))
-               return;
-
-       /* For now do not allow anything that looks like physical CPU HP */
-       if (cpu_present(cpu) && !(sta & ACPI_STA_DEVICE_PRESENT)) {
+       if (!ACPI_FAILURE(status) &&
+           cpu_present(cpu) && !(sta & ACPI_STA_DEVICE_PRESENT))
                pr_err_once("Changing CPU present bit is not supported\n");
-               return;
-       }
 
        unregister_cpu(c);
 }
@@ -566,6 +556,11 @@ struct acpi_madt_generic_interrupt *acpi_cpu_get_madt_gicc(int cpu)
 }
 EXPORT_SYMBOL_GPL(acpi_cpu_get_madt_gicc);
 
+static bool acpi_cpu_is_present(int cpu)
+{
+       return acpi_cpu_get_madt_gicc(cpu)->flags & ACPI_MADT_ENABLED;
+}
+
 /*
  * acpi_map_gic_cpu_interface - parse processor MADT entry
  *
@@ -670,6 +665,10 @@ static void __init acpi_parse_and_init_cpus(void)
                early_map_cpu_to_node(i, acpi_numa_get_nid(i));
 }
 #else
+static bool acpi_cpu_is_present(int cpu)
+{
+       return false;
+}
 #define acpi_parse_and_init_cpus(...)  do { } while (0)
 #endif
 
@@ -814,7 +813,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
                if (err)
                        continue;
 
-               set_cpu_present(cpu, true);
+               if (acpi_disabled || acpi_cpu_is_present(cpu))
+                       set_cpu_present(cpu, true);
                numa_store_cpu_info(cpu);
        }
 }