]> git.dujemihanovic.xyz Git - linux.git/commit
drivers: perf: Fix smp_processor_id() use in preemptible code
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Mon, 26 Aug 2024 16:52:10 +0000 (18:52 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 11 Sep 2024 03:28:02 +0000 (20:28 -0700)
commit2840dadf0dde92638d13b97998026c5fcddbdceb
tree7e44d4f3b862be492c3841ff83b93d4d03f62219
parent1ff95eb2bebda50c4c5406caaf201e0fcb24cc8f
drivers: perf: Fix smp_processor_id() use in preemptible code

As reported in [1], the use of smp_processor_id() in
pmu_sbi_device_probe() must be protected by disabling the preemption, so
simple use get_cpu()/put_cpu() instead.

Reported-by: Nam Cao <namcao@linutronix.de>
Closes: https://lore.kernel.org/linux-riscv/20240820074925.ReMKUPP3@linutronix.de/ [1]
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Nam Cao <namcao@linutronix.de>
Fixes: a8625217a054 ("drivers/perf: riscv: Implement SBI PMU snapshot function")
Reported-by: Andrea Parri <parri.andrea@gmail.com>
Tested-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20240826165210.124696-1-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
drivers/perf/riscv_pmu_sbi.c