]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf/arm-cmn: Fix CMN S3 DTM offset
authorRobin Murphy <robin.murphy@arm.com>
Thu, 18 Sep 2025 16:25:31 +0000 (17:25 +0100)
committerWill Deacon <will@kernel.org>
Thu, 18 Sep 2025 19:18:24 +0000 (20:18 +0100)
CMN S3's DTM offset is different between r0px and r1p0, and it
turns out this was not a error in the earlier documentation, but
does actually exist in the design. Lovely.

Cc: stable@vger.kernel.org
Fixes: 0dc2f4963f7e ("perf/arm-cmn: Support CMN S3")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c

index 11fb2234b10fcfc7a95063bca43afe95375bc7b1..23245352a3fc0aa0219bacca37b451814f6b8862 100644 (file)
@@ -65,7 +65,7 @@
 /* PMU registers occupy the 3rd 4KB page of each node's region */
 #define CMN_PMU_OFFSET                 0x2000
 /* ...except when they don't :( */
-#define CMN_S3_DTM_OFFSET              0xa000
+#define CMN_S3_R1_DTM_OFFSET           0xa000
 #define CMN_S3_PMU_OFFSET              0xd900
 
 /* For most nodes, this is all there is */
@@ -233,6 +233,9 @@ enum cmn_revision {
        REV_CMN700_R1P0,
        REV_CMN700_R2P0,
        REV_CMN700_R3P0,
+       REV_CMNS3_R0P0 = 0,
+       REV_CMNS3_R0P1,
+       REV_CMNS3_R1P0,
        REV_CI700_R0P0 = 0,
        REV_CI700_R1P0,
        REV_CI700_R2P0,
@@ -425,8 +428,8 @@ static enum cmn_model arm_cmn_model(const struct arm_cmn *cmn)
 static int arm_cmn_pmu_offset(const struct arm_cmn *cmn, const struct arm_cmn_node *dn)
 {
        if (cmn->part == PART_CMN_S3) {
-               if (dn->type == CMN_TYPE_XP)
-                       return CMN_S3_DTM_OFFSET;
+               if (cmn->rev >= REV_CMNS3_R1P0 && dn->type == CMN_TYPE_XP)
+                       return CMN_S3_R1_DTM_OFFSET;
                return CMN_S3_PMU_OFFSET;
        }
        return CMN_PMU_OFFSET;