From: Ma Wupeng mawupeng1@huawei.com
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: f43933b3f947 ("arm64: cpufeature: Enable PBHA for stage1 early via FDT") Signed-off-by: Ma Wupeng mawupeng1@huawei.com --- Changelog since v1: - goto found if exists in chosen node --- arch/arm64/kernel/cpufeature.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 36a426b0def2..dee049d27c74 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -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); }
/*