Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pawel Moll and committed by
Arnd Bergmann
fa637bf0 741c798a

+4 -1
+4 -1
drivers/bus/arm-ccn.c
··· 57 57 #define CCN_DT_PMCCNTRSR 0x0190 58 58 #define CCN_DT_PMOVSR 0x0198 59 59 #define CCN_DT_PMOVSR_CLR 0x01a0 60 + #define CCN_DT_PMOVSR_CLR__MASK 0x1f 60 61 #define CCN_DT_PMCR 0x01a8 61 62 #define CCN_DT_PMCR__OVFL_INTR_EN (1 << 6) 62 63 #define CCN_DT_PMCR__PMU_EN (1 << 0) ··· 1053 1052 struct perf_event *event = dt->pmu_counters[idx].event; 1054 1053 int overflowed = pmovsr & BIT(idx); 1055 1054 1056 - WARN_ON_ONCE(overflowed && !event); 1055 + WARN_ON_ONCE(overflowed && !event && 1056 + idx != CCN_IDX_PMU_CYCLE_COUNTER); 1057 1057 1058 1058 if (!event || !overflowed) 1059 1059 continue; ··· 1090 1088 /* Initialize DT subsystem */ 1091 1089 ccn->dt.base = ccn->base + CCN_REGION_SIZE; 1092 1090 spin_lock_init(&ccn->dt.config_lock); 1091 + writel(CCN_DT_PMOVSR_CLR__MASK, ccn->dt.base + CCN_DT_PMOVSR_CLR); 1093 1092 writel(CCN_DT_CTL__DT_EN, ccn->dt.base + CCN_DT_CTL); 1094 1093 writel(CCN_DT_PMCR__OVFL_INTR_EN | CCN_DT_PMCR__PMU_EN, 1095 1094 ccn->dt.base + CCN_DT_PMCR);