diff options
author | Jorge A. Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> | 2015-06-17 23:30:03 -0400 |
---|---|---|
committer | Jorge A. Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> | 2015-06-17 23:30:03 -0400 |
commit | 5ee26504aebf316b9f92bf963738c4d3aba54809 (patch) | |
tree | 9fe3f11b602ee19307067f6afe26b46aea4fb533 /arch | |
parent | 95922200477d2d3c4683510e2e82f5a2232ebe97 (diff) | |
parent | f12c14e9130df9449949f79fa1ec2b119a3577c8 (diff) |
Merge pull request #86 from william-wfei/hikey
perf(pmu event): hikey: enable pmu on hikey board
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/boot/dts/hi6220.dtsi | 10 | ||||
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 15 |
2 files changed, 24 insertions, 1 deletions
diff --git a/arch/arm64/boot/dts/hi6220.dtsi b/arch/arm64/boot/dts/hi6220.dtsi index 06795c8b6384..d6ad83606b48 100644 --- a/arch/arm64/boot/dts/hi6220.dtsi +++ b/arch/arm64/boot/dts/hi6220.dtsi @@ -221,6 +221,16 @@ mask = <0x48698284>; }; + acpu_ctrl: acpu_ctrl@f6504000 { + compatible = "hisilicon,acpuctrl"; + reg = <0x0 0xf6504000 0x0 0x1000>; + }; + + pmu { + compatible = "arm,armv8-pmuv3"; + interrupts = <0 99 4>; + }; + smb { compatible = "simple-bus"; #address-cells = <2>; diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index aa29ecb4f800..8391ced4345b 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -1068,6 +1068,19 @@ static void armv8pmu_disable_event(struct hw_perf_event *hwc, int idx) raw_spin_unlock_irqrestore(&events->pmu_lock, flags); } +static irqreturn_t armv8pmu_handle_irq_none(int irq_num, void *dev) +{ + int next; + if (num_online_cpus() > 1) { + next = cpumask_next(smp_processor_id(), cpu_online_mask); + if (next > nr_cpu_ids) + next = cpumask_next(-1, cpu_online_mask); + irq_set_affinity(irq_num, cpumask_of(next)); + } + + return IRQ_NONE; +} + static irqreturn_t armv8pmu_handle_irq(int irq_num, void *dev) { u32 pmovsr; @@ -1085,7 +1098,7 @@ static irqreturn_t armv8pmu_handle_irq(int irq_num, void *dev) * Did an overflow occur? */ if (!armv8pmu_has_overflowed(pmovsr)) - return IRQ_NONE; + return armv8pmu_handle_irq_none(irq_num, dev); /* * Handle the counter(s) overflow(s) |