arm64: smp: Handle errors reported by the firmware
authorSuzuki K Poulose <Suzuki.Poulose@arm.com>
Mon, 10 Dec 2018 18:07:33 +0000 (18:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:13 +0000 (15:37 +0100)
[ Upstream commit f357b3a7e17af7736d67d8267edc1ed3d1dd9391 ]

The __cpu_up() routine ignores the errors reported by the firmware
for a CPU bringup operation and looks for the error status set by the
booting CPU. If the CPU never entered the kernel, we could end up
in assuming stale error status, which otherwise would have been
set/cleared appropriately by the booting CPU.

Reported-by: Steve Capper <steve.capper@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kernel/smp.c

index 0881dfab10f8fabd6d94c8ec57763851ae915155..909bf3926fd235c63b5cc1303ff6b58323f06d93 100644 (file)
@@ -144,6 +144,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
                }
        } else {
                pr_err("CPU%u: failed to boot: %d\n", cpu, ret);
+               return ret;
        }
 
        secondary_data.task = NULL;