]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
RISC-V: Fix error code returned by riscv_hartid_to_cpuid()
authorAnup Patel <anup.patel@wdc.com>
Thu, 15 Apr 2021 08:55:22 +0000 (14:25 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 18 Jun 2021 13:02:13 +0000 (15:02 +0200)
commitcf54a67738309e4e841f053ce731c99146d54afb
treeb32149411d315f3c6891fef784c47e7ddace81f4
parent99502ee7da32950c860da5f4d59e3e7455a32d65
RISC-V: Fix error code returned by riscv_hartid_to_cpuid()

BugLink: https://bugs.launchpad.net/bugs/1930474
[ Upstream commit 533b4f3a789d49574e7ae0f6ececed153f651f97 ]

We should return a negative error code upon failure in
riscv_hartid_to_cpuid() instead of NR_CPUS. This is also
aligned with all uses of riscv_hartid_to_cpuid() which
expect negative error code upon failure.

Fixes: 6825c7a80f18 ("RISC-V: Add logical CPU indexing for RISC-V")
Fixes: f99fb607fb2b ("RISC-V: Use Linux logical CPU number instead of hartid")
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/riscv/kernel/smp.c