aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus/arm-ccn.c
diff options
context:
space:
mode:
authorPawel Moll <pawel.moll@arm.com>2014-09-15 10:33:48 -0400
committerArnd Bergmann <arnd@arndb.de>2014-10-08 15:31:14 -0400
commitfa637bf0595ee1796d728a0d33b6b7fff12e1f3d (patch)
tree23c0b97702221f298787f755ec7f6a8f3ac7b20c /drivers/bus/arm-ccn.c
parent741c798a0229c9523c1f68bc8c83a79fefad4333 (diff)
bus: arm-ccn: Fix spurious warning message
Because CCN's cycle counter always runs, it will generate an interrupt on overflow even if the relevant perf event was not requested, causing a spurious warning message. Fixed now by warning on only normal counter unwanted overflows. Also cleaning the overflow mask at init now, not to warn on event previously requested by firmware. Signed-off-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/bus/arm-ccn.c')
-rw-r--r--drivers/bus/arm-ccn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 6f550d9e7a2d..f5bca3113bfc 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -57,6 +57,7 @@
57#define CCN_DT_PMCCNTRSR 0x0190 57#define CCN_DT_PMCCNTRSR 0x0190
58#define CCN_DT_PMOVSR 0x0198 58#define CCN_DT_PMOVSR 0x0198
59#define CCN_DT_PMOVSR_CLR 0x01a0 59#define CCN_DT_PMOVSR_CLR 0x01a0
60#define CCN_DT_PMOVSR_CLR__MASK 0x1f
60#define CCN_DT_PMCR 0x01a8 61#define CCN_DT_PMCR 0x01a8
61#define CCN_DT_PMCR__OVFL_INTR_EN (1 << 6) 62#define CCN_DT_PMCR__OVFL_INTR_EN (1 << 6)
62#define CCN_DT_PMCR__PMU_EN (1 << 0) 63#define CCN_DT_PMCR__PMU_EN (1 << 0)
@@ -1052,7 +1053,8 @@ static irqreturn_t arm_ccn_pmu_overflow_handler(struct arm_ccn_dt *dt)
1052 struct perf_event *event = dt->pmu_counters[idx].event; 1053 struct perf_event *event = dt->pmu_counters[idx].event;
1053 int overflowed = pmovsr & BIT(idx); 1054 int overflowed = pmovsr & BIT(idx);
1054 1055
1055 WARN_ON_ONCE(overflowed && !event); 1056 WARN_ON_ONCE(overflowed && !event &&
1057 idx != CCN_IDX_PMU_CYCLE_COUNTER);
1056 1058
1057 if (!event || !overflowed) 1059 if (!event || !overflowed)
1058 continue; 1060 continue;
@@ -1088,6 +1090,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
1088 /* Initialize DT subsystem */ 1090 /* Initialize DT subsystem */
1089 ccn->dt.base = ccn->base + CCN_REGION_SIZE; 1091 ccn->dt.base = ccn->base + CCN_REGION_SIZE;
1090 spin_lock_init(&ccn->dt.config_lock); 1092 spin_lock_init(&ccn->dt.config_lock);
1093 writel(CCN_DT_PMOVSR_CLR__MASK, ccn->dt.base + CCN_DT_PMOVSR_CLR);
1091 writel(CCN_DT_CTL__DT_EN, ccn->dt.base + CCN_DT_CTL); 1094 writel(CCN_DT_CTL__DT_EN, ccn->dt.base + CCN_DT_CTL);
1092 writel(CCN_DT_PMCR__OVFL_INTR_EN | CCN_DT_PMCR__PMU_EN, 1095 writel(CCN_DT_PMCR__OVFL_INTR_EN | CCN_DT_PMCR__PMU_EN,
1093 ccn->dt.base + CCN_DT_PMCR); 1096 ccn->dt.base + CCN_DT_PMCR);