Skip to content

Commit

Permalink
powerpc: avoid lockdep when we are offline
Browse files Browse the repository at this point in the history
This is second version of my fix to PPC's  "WARNING: suspicious RCU usage",
I improved my fix under Paul E. McKenney's guidance:
Link: https://lore.kernel.org/lkml/[email protected]/T/

During the cpu offlining, the sub functions of xive_teardown_cpu will
call __lock_acquire when CONFIG_LOCKDEP=y. The latter function will
travel RCU protected list, so "WARNING: suspicious RCU usage" will be
triggered.

Avoid lockdep when we are offline.

Signed-off-by: Zhouyi Zhou <[email protected]>
  • Loading branch information
zhouzhouyi-hub authored and chantra committed Sep 27, 2022
1 parent 6445a5a commit b68f16d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/powerpc/platforms/pseries/hotplug-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ static void pseries_cpu_offline_self(void)

local_irq_disable();
idle_task_exit();
/* prevent lockdep code from traveling RCU protected list
* when we are offline.
*/
lockdep_off();
if (xive_enabled())
xive_teardown_cpu();
else
xics_teardown_cpu();
lockdep_on();

unregister_slb_shadow(hwcpu);
rtas_stop_self();
Expand Down

0 comments on commit b68f16d

Please sign in to comment.