Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd4891bf authored by Se Wang (Patrick) Oh's avatar Se Wang (Patrick) Oh
Browse files

perf: Fix mutex call with interrupt disabled in cpu_pmu_notify



As cpu_pmu_notify is called in the secondary kernel start API,
the interrupt is still not enabled when cpu_pmu_notify is called.
platform_get_irq uses mutex, it causes a panic - sleeping
function called from invalid context. So use the internal
irq number in arm pmu structure instead of getting it
from platform_get_irq again.

Change-Id: If80b20f13d9c533a0043e5e8eb506611170d11fd
Signed-off-by: default avatarSe Wang (Patrick) Oh <sewango@codeaurora.org>
parent d9479b68
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1512,7 +1512,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
					armpmu_hotplug_disable, cpu_pmu, 1);
			/* Disarm the PMU IRQ before disappearing. */
			if (cpu_pmu->plat_device) {
				irq = platform_get_irq(cpu_pmu->plat_device, 0);
				irq = cpu_pmu->percpu_irq;
				smp_call_function_single(cpu,
					    armpmu_disable_percpu_irq, &irq, 1);
			}
@@ -1529,7 +1529,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
		if (cpu_pmu->pmu_state == ARM_PMU_STATE_RUNNING) {
			/* Arm the PMU IRQ before appearing. */
			if (cpu_pmu->plat_device) {
				irq = platform_get_irq(cpu_pmu->plat_device, 0);
				irq = cpu_pmu->percpu_irq;
				armpmu_enable_percpu_irq(&irq);
			}
			if (cpu_has_active_perf(cpu)) {