Commit 985bab23 authored by Jing Li's avatar Jing Li Committed by guzitao
Browse files

sw64: acpi: remove constraint that cid of boot core must be zero

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IBDJNZ



--------------------------------

Commit 2a50f1089385 ("sw64: acpi: parse SW CINTC for SMP
initialization") introduces a constraint that cid of boot core must be
zero. Actually, the boot core is the first online core, and its cid does
not have to be zero.

Fixes: 2a50f1089385 ("sw64: acpi: parse SW CINTC for SMP initialization")
Signed-off-by: default avatarJing Li <jingli@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 44d20671
Loading
Loading
Loading
Loading
+6 −17
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ EXPORT_SYMBOL(acpi_pci_disabled);
static bool param_acpi_on  __initdata;
static bool param_acpi_off __initdata;

static unsigned int possible_cores = 1; /* number of possible cores(at least boot core) */
static unsigned int present_cores = 1;  /* number of present cores(at least boot core) */
static unsigned int possible_cores; /* number of possible cores */
static unsigned int present_cores;  /* number of present cores */
static unsigned int disabled_cores; /* number of disabled cores */

int acpi_strict;
@@ -257,12 +257,6 @@ setup_rcid_and_core_mask(struct acpi_madt_sw_cintc *sw_cintc)
		return -EINVAL;
	}

	/* We can never disable the boot core, whose rcid is 0 */
	if ((rcid == 0) && !is_core_enabled(sw_cintc->flags)) {
		pr_err(PREFIX "Boot core disabled in MADT\n");
		return -EINVAL;
	}

	/* Online capable makes core possible */
	if (!is_core_enabled(sw_cintc->flags) &&
			!is_core_online_capable(sw_cintc->flags)) {
@@ -270,14 +264,10 @@ setup_rcid_and_core_mask(struct acpi_madt_sw_cintc *sw_cintc)
		return 0;
	}

	rcid_information_init(sw_cintc->version);

	/* The logical core ID of the boot core must be 0 */
	if (rcid == 0)
		logical_core_id = 0;
	else
	logical_core_id = possible_cores++;

	rcid_information_init(sw_cintc->version);

	set_rcid_map(logical_core_id, rcid);
	set_cpu_possible(logical_core_id, true);
	store_cpu_data(logical_core_id);
@@ -291,7 +281,6 @@ setup_rcid_and_core_mask(struct acpi_madt_sw_cintc *sw_cintc)
	if (is_core_enabled(sw_cintc->flags) &&
			!cpumask_test_cpu(logical_core_id, &cpu_offline)) {
		set_cpu_present(logical_core_id, true);
		if (logical_core_id != 0)
		present_cores++;
	}