aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/bus/arm-cci.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 7ce7da0a17c7..bcc4c59c1e39 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -640,18 +640,23 @@ void cci_pmu_sync_counters(struct cci_pmu *cci_pmu)
640} 640}
641 641
642/* Should be called with cci_pmu->hw_events->pmu_lock held */ 642/* Should be called with cci_pmu->hw_events->pmu_lock held */
643static void __cci_pmu_enable(struct cci_pmu *cci_pmu) 643static void __cci_pmu_enable_nosync(struct cci_pmu *cci_pmu)
644{ 644{
645 u32 val; 645 u32 val;
646 646
647 cci_pmu_sync_counters(cci_pmu);
648
649 /* Enable all the PMU counters. */ 647 /* Enable all the PMU counters. */
650 val = readl_relaxed(cci_ctrl_base + CCI_PMCR) | CCI_PMCR_CEN; 648 val = readl_relaxed(cci_ctrl_base + CCI_PMCR) | CCI_PMCR_CEN;
651 writel(val, cci_ctrl_base + CCI_PMCR); 649 writel(val, cci_ctrl_base + CCI_PMCR);
652} 650}
653 651
654/* Should be called with cci_pmu->hw_events->pmu_lock held */ 652/* Should be called with cci_pmu->hw_events->pmu_lock held */
653static void __cci_pmu_enable_sync(struct cci_pmu *cci_pmu)
654{
655 cci_pmu_sync_counters(cci_pmu);
656 __cci_pmu_enable_nosync(cci_pmu);
657}
658
659/* Should be called with cci_pmu->hw_events->pmu_lock held */
655static void __cci_pmu_disable(void) 660static void __cci_pmu_disable(void)
656{ 661{
657 u32 val; 662 u32 val;
@@ -960,7 +965,7 @@ static irqreturn_t pmu_handle_irq(int irq_num, void *dev)
960 } 965 }
961 966
962 /* Enable the PMU and sync possibly overflowed counters */ 967 /* Enable the PMU and sync possibly overflowed counters */
963 __cci_pmu_enable(cci_pmu); 968 __cci_pmu_enable_sync(cci_pmu);
964 raw_spin_unlock_irqrestore(&events->pmu_lock, flags); 969 raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
965 970
966 return IRQ_RETVAL(handled); 971 return IRQ_RETVAL(handled);
@@ -1004,7 +1009,7 @@ static void cci_pmu_enable(struct pmu *pmu)
1004 return; 1009 return;
1005 1010
1006 raw_spin_lock_irqsave(&hw_events->pmu_lock, flags); 1011 raw_spin_lock_irqsave(&hw_events->pmu_lock, flags);
1007 __cci_pmu_enable(cci_pmu); 1012 __cci_pmu_enable_sync(cci_pmu);
1008 raw_spin_unlock_irqrestore(&hw_events->pmu_lock, flags); 1013 raw_spin_unlock_irqrestore(&hw_events->pmu_lock, flags);
1009 1014
1010} 1015}