Skip to content

Commit adde871

Browse files
npigginmpe
authored andcommitted
powerpc/pseries: Avoid harmless preempt warning
Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e86350f commit adde871

File tree

1 file changed

+9
-1
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+9
-1
lines changed

arch/powerpc/platforms/pseries/lpar.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,16 @@ static const struct proc_ops vcpudispatch_stats_freq_proc_ops = {
636636

637637
static int __init vcpudispatch_stats_procfs_init(void)
638638
{
639-
if (!lppaca_shared_proc(get_lppaca()))
639+
/*
640+
* Avoid smp_processor_id while preemptible. All CPUs should have
641+
* the same value for lppaca_shared_proc.
642+
*/
643+
preempt_disable();
644+
if (!lppaca_shared_proc(get_lppaca())) {
645+
preempt_enable();
640646
return 0;
647+
}
648+
preempt_enable();
641649

642650
if (!proc_create("powerpc/vcpudispatch_stats", 0600, NULL,
643651
&vcpudispatch_stats_proc_ops))

0 commit comments

Comments
 (0)