diff options
| author | Anju T Sudhakar <anju@linux.vnet.ibm.com> | 2017-12-05 00:30:38 -0500 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-12-13 04:36:53 -0500 |
| commit | ad2b6e01024ef23bddc3ce0bcb115ecd8c520b7e (patch) | |
| tree | 56a6e27a464240df94eb682159d88f5756019a02 | |
| parent | f41d84dddc66b164ac16acf3f584c276146f1c48 (diff) | |
powerpc/perf/imc: Fix nest-imc cpuhotplug callback failure
Oops is observed during boot:
Faulting instruction address: 0xc000000000248340
cpu 0x0: Vector: 380 (Data Access Out of Range) at [c000000ff66fb850]
pc: c000000000248340: event_function_call+0x50/0x1f0
lr: c00000000024878c: perf_remove_from_context+0x3c/0x100
sp: c000000ff66fbad0
msr: 9000000000009033
dar: 7d20e2a6f92d03c0
pid = 14, comm = cpuhp/0
While registering the cpuhotplug callbacks for nest-imc, if we fail in
the cpuhotplug online path for any random node in a multi node
system (because the opal call to stop nest-imc counters fails for that
node), ppc_nest_imc_cpu_offline() will get invoked for other nodes who
successfully returned from cpuhotplug online path.
This call trace is generated since in the ppc_nest_imc_cpu_offline()
path we are trying to migrate the event context, when nest-imc
counters are not even initialized.
Patch to add a check to ensure that nest-imc is registered before
migrating the event context.
Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support")
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
| -rw-r--r-- | arch/powerpc/perf/imc-pmu.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 0ead3cd73caa..f1b940714d65 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c | |||
| @@ -310,6 +310,19 @@ static int ppc_nest_imc_cpu_offline(unsigned int cpu) | |||
| 310 | return 0; | 310 | return 0; |
| 311 | 311 | ||
| 312 | /* | 312 | /* |
| 313 | * Check whether nest_imc is registered. We could end up here if the | ||
| 314 | * cpuhotplug callback registration fails. i.e, callback invokes the | ||
| 315 | * offline path for all successfully registered nodes. At this stage, | ||
| 316 | * nest_imc pmu will not be registered and we should return here. | ||
| 317 | * | ||
| 318 | * We return with a zero since this is not an offline failure. And | ||
| 319 | * cpuhp_setup_state() returns the actual failure reason to the caller, | ||
| 320 | * which in turn will call the cleanup routine. | ||
| 321 | */ | ||
| 322 | if (!nest_pmus) | ||
| 323 | return 0; | ||
| 324 | |||
| 325 | /* | ||
| 313 | * Now that this cpu is one of the designated, | 326 | * Now that this cpu is one of the designated, |
| 314 | * find a next cpu a) which is online and b) in same chip. | 327 | * find a next cpu a) which is online and b) in same chip. |
| 315 | */ | 328 | */ |
