diff options
Diffstat (limited to 'drivers/perf/arm_pmu.c')
-rw-r--r-- | drivers/perf/arm_pmu.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 6ccb994bdfcb..c494613c1909 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c | |||
@@ -688,7 +688,7 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler) | |||
688 | return 0; | 688 | return 0; |
689 | } | 689 | } |
690 | 690 | ||
691 | static DEFINE_MUTEX(arm_pmu_mutex); | 691 | static DEFINE_SPINLOCK(arm_pmu_lock); |
692 | static LIST_HEAD(arm_pmu_list); | 692 | static LIST_HEAD(arm_pmu_list); |
693 | 693 | ||
694 | /* | 694 | /* |
@@ -701,7 +701,7 @@ static int arm_perf_starting_cpu(unsigned int cpu) | |||
701 | { | 701 | { |
702 | struct arm_pmu *pmu; | 702 | struct arm_pmu *pmu; |
703 | 703 | ||
704 | mutex_lock(&arm_pmu_mutex); | 704 | spin_lock(&arm_pmu_lock); |
705 | list_for_each_entry(pmu, &arm_pmu_list, entry) { | 705 | list_for_each_entry(pmu, &arm_pmu_list, entry) { |
706 | 706 | ||
707 | if (!cpumask_test_cpu(cpu, &pmu->supported_cpus)) | 707 | if (!cpumask_test_cpu(cpu, &pmu->supported_cpus)) |
@@ -709,7 +709,7 @@ static int arm_perf_starting_cpu(unsigned int cpu) | |||
709 | if (pmu->reset) | 709 | if (pmu->reset) |
710 | pmu->reset(pmu); | 710 | pmu->reset(pmu); |
711 | } | 711 | } |
712 | mutex_unlock(&arm_pmu_mutex); | 712 | spin_unlock(&arm_pmu_lock); |
713 | return 0; | 713 | return 0; |
714 | } | 714 | } |
715 | 715 | ||
@@ -821,9 +821,9 @@ static int cpu_pmu_init(struct arm_pmu *cpu_pmu) | |||
821 | if (!cpu_hw_events) | 821 | if (!cpu_hw_events) |
822 | return -ENOMEM; | 822 | return -ENOMEM; |
823 | 823 | ||
824 | mutex_lock(&arm_pmu_mutex); | 824 | spin_lock(&arm_pmu_lock); |
825 | list_add_tail(&cpu_pmu->entry, &arm_pmu_list); | 825 | list_add_tail(&cpu_pmu->entry, &arm_pmu_list); |
826 | mutex_unlock(&arm_pmu_mutex); | 826 | spin_unlock(&arm_pmu_lock); |
827 | 827 | ||
828 | err = cpu_pm_pmu_register(cpu_pmu); | 828 | err = cpu_pm_pmu_register(cpu_pmu); |
829 | if (err) | 829 | if (err) |
@@ -859,9 +859,9 @@ static int cpu_pmu_init(struct arm_pmu *cpu_pmu) | |||
859 | return 0; | 859 | return 0; |
860 | 860 | ||
861 | out_unregister: | 861 | out_unregister: |
862 | mutex_lock(&arm_pmu_mutex); | 862 | spin_lock(&arm_pmu_lock); |
863 | list_del(&cpu_pmu->entry); | 863 | list_del(&cpu_pmu->entry); |
864 | mutex_unlock(&arm_pmu_mutex); | 864 | spin_unlock(&arm_pmu_lock); |
865 | free_percpu(cpu_hw_events); | 865 | free_percpu(cpu_hw_events); |
866 | return err; | 866 | return err; |
867 | } | 867 | } |
@@ -869,9 +869,9 @@ out_unregister: | |||
869 | static void cpu_pmu_destroy(struct arm_pmu *cpu_pmu) | 869 | static void cpu_pmu_destroy(struct arm_pmu *cpu_pmu) |
870 | { | 870 | { |
871 | cpu_pm_pmu_unregister(cpu_pmu); | 871 | cpu_pm_pmu_unregister(cpu_pmu); |
872 | mutex_lock(&arm_pmu_mutex); | 872 | spin_lock(&arm_pmu_lock); |
873 | list_del(&cpu_pmu->entry); | 873 | list_del(&cpu_pmu->entry); |
874 | mutex_unlock(&arm_pmu_mutex); | 874 | spin_unlock(&arm_pmu_lock); |
875 | free_percpu(cpu_pmu->hw_events); | 875 | free_percpu(cpu_pmu->hw_events); |
876 | } | 876 | } |
877 | 877 | ||
@@ -967,11 +967,12 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) | |||
967 | 967 | ||
968 | /* If we didn't manage to parse anything, try the interrupt affinity */ | 968 | /* If we didn't manage to parse anything, try the interrupt affinity */ |
969 | if (cpumask_weight(&pmu->supported_cpus) == 0) { | 969 | if (cpumask_weight(&pmu->supported_cpus) == 0) { |
970 | if (!using_spi) { | 970 | int irq = platform_get_irq(pdev, 0); |
971 | |||
972 | if (irq_is_percpu(irq)) { | ||
971 | /* If using PPIs, check the affinity of the partition */ | 973 | /* If using PPIs, check the affinity of the partition */ |
972 | int ret, irq; | 974 | int ret; |
973 | 975 | ||
974 | irq = platform_get_irq(pdev, 0); | ||
975 | ret = irq_get_percpu_devid_partition(irq, &pmu->supported_cpus); | 976 | ret = irq_get_percpu_devid_partition(irq, &pmu->supported_cpus); |
976 | if (ret) { | 977 | if (ret) { |
977 | kfree(irqs); | 978 | kfree(irqs); |