Commit 77df75b6 authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

arm64: mm: Stop use spinlock during pbha early init

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I96IZH



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

During early_pbha_init() in __primary_switched(), debug spinlock related
function is not fully initialized. This will lead to kernel unable to
boot with CONFIG_LOCK_STAT=y or related configs. Since kernel is running
with only one cpu during startup, there is no need to use lock. Fix it by
removing the spinlock.

Fixes: f43933b3 ("arm64: cpufeature: Enable PBHA for stage1 early via FDT")
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent b40c2021
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -1796,16 +1796,14 @@ void __init early_pbha_init(void)
	const u8 *prop;
	int size;

	spin_lock(&pbha_dt_lock);

	fdt = get_early_fdt_ptr();
	if (!fdt)
		goto unlock;
		return;

	/* arm,pbha-performance-only may exist in both chosen and cpus node */
	node = fdt_path_offset(fdt, "/chosen");
	if (node < 0)
		goto unlock;
		return;

	prop = fdt_getprop(fdt, node, "arm,pbha-performance-only", &size);
	if (prop)
@@ -1813,15 +1811,15 @@ void __init early_pbha_init(void)

	node = fdt_path_offset(fdt, "/cpus");
	if (node < 0)
		goto unlock;
		return;

	prop = fdt_getprop(fdt, node, "arm,pbha-performance-only", &size);
	if (prop)
		goto unlock;
		return;

found:
	if (!cpu_has_pbha())
		goto unlock;
		return;

	update_pbha_perf_only_bit(prop, size);
	enable_pbha_inner();
@@ -1829,9 +1827,6 @@ void __init early_pbha_init(void)
	pbha_enabled = true;

	early_pbha_bit0_init();

unlock:
	spin_unlock(&pbha_dt_lock);
}

/*