Skip to content

Commit 88b63a8

Browse files
rmurphy-armwilldeacon
authored andcommitted
perf/arm-cmn: Fix CCLA register offset
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]>
1 parent e79634b commit 88b63a8

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 */
@@ -2393,10 +2394,13 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
23932394
case CMN_TYPE_CXHA:
23942395
case CMN_TYPE_CCRA:
23952396
case CMN_TYPE_CCHA:
2396-
case CMN_TYPE_CCLA:
23972397
case CMN_TYPE_HNS:
23982398
dn++;
23992399
break;
2400+
case CMN_TYPE_CCLA:
2401+
dn->pmu_base += CMN_CCLA_PMU_EVENT_SEL;
2402+
dn++;
2403+
break;
24002404
/* Nothing to see here */
24012405
case CMN_TYPE_MPAM_S:
24022406
case CMN_TYPE_MPAM_NS:
@@ -2414,7 +2418,7 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
24142418
case CMN_TYPE_HNP:
24152419
case CMN_TYPE_CCLA_RNI:
24162420
dn[1] = dn[0];
2417-
dn[0].pmu_base += CMN_HNP_PMU_EVENT_SEL;
2421+
dn[0].pmu_base += CMN_CCLA_PMU_EVENT_SEL;
24182422
dn[1].type = arm_cmn_subtype(dn->type);
24192423
dn += 2;
24202424
break;

0 commit comments

Comments
 (0)