diff options
author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2014-04-28 18:15:24 +0530 |
---|---|---|
committer | Eli Qiao <taget@linux.vnet.ibm.com> | 2014-04-29 13:23:58 +0800 |
commit | 13a6cbe6b267beb50cea40a9dc7702cfd2a08678 (patch) | |
tree | 823b3c007c10fa13cff108dad11acce932b987f0 | |
parent | 60e7bd31571159280f7441338d4d74856b70cd3d (diff) | |
download | powerpc-13a6cbe6b267beb50cea40a9dc7702cfd2a08678.tar.gz |
powerpc/powernv: Protect split-core operations from CPU hotplug
During split-core operations, one of the online CPUs is nominated as the
"master" and then stop_machine() is invoked to perform the split/unsplit
procedure. Between these 2 steps, if CPU hotplug occurs and takes the
just nominated "master" CPU offline, then the split/unsplit procedure
does not complete properly and leads to undesirable effects.
So protect the entire split-core operation with get/put_online_cpus()
to synchronize with CPU hotplug.
Fixes bz 105509.
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
-rw-r--r-- | arch/powerpc/platforms/powernv/subcore.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c index 34caafea0c3874..f53c1781f1ebac 100644 --- a/arch/powerpc/platforms/powernv/subcore.c +++ b/arch/powerpc/platforms/powernv/subcore.c @@ -335,6 +335,8 @@ static int set_subcores_per_core(int new_mode) state->master = 0; } + get_online_cpus(); + /* This cpu will update the globals before exiting stop machine */ this_cpu_ptr(&split_state)->master = 1; @@ -343,6 +345,8 @@ static int set_subcores_per_core(int new_mode) stop_machine(cpu_update_split_mode, &new_mode, cpu_online_mask); + put_online_cpus(); + return 0; } |