Skip to content

Commit 5418a61

Browse files
rmurphy-armgregkh
authored andcommitted
perf/arm-cmn: Fix CCLA register offset
[ Upstream commit 88b63a8 ] Apparently pmu_event_sel is offset by 8 for all CCLA nodes, not just the CCLA_RNI combination type. Fixes: 23760a0 ("perf/arm-cmn: Add CMN-700 support") Acked-by: Mark Rutland <[email protected]> Reviewed-by: Ilkka Koskinen <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/6e7bb06fef6046f83e7647aad0e5be544139763f.1725296395.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a687d9d commit 5418a61

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/perf/arm-cmn.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
/* Technically this is 4 bits wide on DNs, but we only use 2 there anyway */
7171
#define CMN__PMU_OCCUP1_ID GENMASK_ULL(34, 32)
7272

73-
/* HN-Ps are weird... */
73+
/* Some types are designed to coexist with another device in the same node */
74+
#define CMN_CCLA_PMU_EVENT_SEL 0x008
7475
#define CMN_HNP_PMU_EVENT_SEL 0x008
7576

7677
/* DTMs live in the PMU space of XP registers */
@@ -2321,10 +2322,13 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
23212322
case CMN_TYPE_CXHA:
23222323
case CMN_TYPE_CCRA:
23232324
case CMN_TYPE_CCHA:
2324-
case CMN_TYPE_CCLA:
23252325
case CMN_TYPE_HNS:
23262326
dn++;
23272327
break;
2328+
case CMN_TYPE_CCLA:
2329+
dn->pmu_base += CMN_CCLA_PMU_EVENT_SEL;
2330+
dn++;
2331+
break;
23282332
/* Nothing to see here */
23292333
case CMN_TYPE_MPAM_S:
23302334
case CMN_TYPE_MPAM_NS:
@@ -2342,7 +2346,7 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
23422346
case CMN_TYPE_HNP:
23432347
case CMN_TYPE_CCLA_RNI:
23442348
dn[1] = dn[0];
2345-
dn[0].pmu_base += CMN_HNP_PMU_EVENT_SEL;
2349+
dn[0].pmu_base += CMN_CCLA_PMU_EVENT_SEL;
23462350
dn[1].type = arm_cmn_subtype(dn->type);
23472351
dn += 2;
23482352
break;

0 commit comments

Comments
 (0)