aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-11-04 19:18:56 -0700
committerSiqi Lin <siqilin@google.com>2016-11-07 19:28:01 +0000
commitbd96fbf88cb586b65a04683ad3abbf7006857f31 (patch)
tree749063559ea5a1defbb73c381bb734f81705efc5
parentcfb9f424f504635dc1c73dfdf2ba79b046c784bb (diff)
perf:arm64: fix lockdep warning when handling CPU_STARTING.android-n-mr1-preview-2_r0.6android-7.1.1_r0.6
When hanlding CPU_STARTING event, cpu_pmu_notify() calls platform_get_irq()->of_irq_get()->irq_find_matching_host() ->mutex_lock(). To avoid sleeping when handling CPU_STARTING event, cache percpu_irq number in struct arm_pmu. Bug: 32646661 Change-Id: I2c40013ab5cc7549e8ec1ab38eea493845a45c09 (cherry picked from commit 9b216b0e5a41419472a7fa8d39c0877ffe265c9a)
-rw-r--r--arch/arm64/include/asm/pmu.h1
-rw-r--r--arch/arm64/kernel/perf_event.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/pmu.h b/arch/arm64/include/asm/pmu.h
index 497b52e08845..53d992a6c6f1 100644
--- a/arch/arm64/include/asm/pmu.h
+++ b/arch/arm64/include/asm/pmu.h
@@ -44,6 +44,7 @@ struct pmu_hw_events {
struct arm_pmu {
struct pmu pmu;
bool percpu_irq_requested;
+ int percpu_irq;
cpumask_t active_irqs;
const char *name;
irqreturn_t (*handle_irq)(int irq_num, void *dev);
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index 9a54f6ae3853..a07d1f40eaf4 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1045,6 +1045,7 @@ static int armv8pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
on_each_cpu(armpmu_enable_percpu_irq, &irq, 1);
cpu_pmu->percpu_irq_requested = true;
+ cpu_pmu->percpu_irq = irq;
} else {
for (i = 0; i < irqs; ++i) {
err = 0;
@@ -1342,7 +1343,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_DOWN_PREPARE:
if (pmu->percpu_irq_requested) {
- int irq = platform_get_irq(pmu->plat_device, 0);
+ int irq = pmu->percpu_irq;
smp_call_function_single(cpu,
armpmu_disable_percpu_irq, &irq, 1);
}
@@ -1353,7 +1354,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
if (pmu->reset)
pmu->reset(pmu);
if (pmu->percpu_irq_requested) {
- int irq = platform_get_irq(pmu->plat_device, 0);
+ int irq = pmu->percpu_irq;
smp_call_function_single(cpu,
armpmu_enable_percpu_irq, &irq, 1);
}