* [PATCH] perf/arm-cmn: Fix {wp_dev_sel2, wp_dev_sel} limited to 0/1 when MXP_MULTIPLE_DTM_EN is TRUE
@ 2026-08-19 10:54 Shouping Wang
0 siblings, 0 replies; only message in thread
From: Shouping Wang @ 2026-08-19 10:54 UTC (permalink / raw)
To: will, robin.murphy
Cc: linux-arm-kernel, linux-kernel, mark.rutland, peter.du, andy.xu,
allen.wang
When MXP_MULTIPLE_DTM_EN is TRUE, each DTM will monitor at most
two device ports. In this case, {wp_dev_sel2, wp_dev_sel} will
only use values 2'b00 and 2'b01 per DTM.
Previously the setting allowed values beyond the supported range
per DTM, which could cause each DTM to select invalid ports when
MXP_MULTIPLE_DTM_EN is TRUE.
Fix this by applying `dev %= 2` to clamp the selection value to
the valid range when MXP_MULTIPLE_DTM_EN is TRUE.
Fixes: 60d1504070c2 ("perf/arm-cmn: Support new IP features")
Signed-off-by: Shouping Wang <allen.wang@hj-micro.com>
---
drivers/perf/arm-cmn.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 40c05c519a1d..13ccbf2a7345 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -1392,6 +1392,7 @@ static void arm_cmn_claim_wp_idx(struct arm_cmn_dtm *dtm,
static u32 arm_cmn_wp_config(struct perf_event *event, int wp_idx)
{
+ struct arm_cmn *cmn = to_cmn(event->pmu);
u32 config;
u32 dev = CMN_EVENT_WP_DEV_SEL(event);
u32 chn = CMN_EVENT_WP_CHN_SEL(event);
@@ -1404,6 +1405,9 @@ static u32 arm_cmn_wp_config(struct perf_event *event, int wp_idx)
if (is_cmn600)
grp &= 1;
+ if (cmn->multi_dtm)
+ dev %= 2;
+
config = FIELD_PREP(CMN_DTM_WPn_CONFIG_WP_DEV_SEL, dev) |
FIELD_PREP(CMN_DTM_WPn_CONFIG_WP_CHN_SEL, chn) |
FIELD_PREP(CMN_DTM_WPn_CONFIG_WP_GRP, grp) |
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-19 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 10:54 [PATCH] perf/arm-cmn: Fix {wp_dev_sel2, wp_dev_sel} limited to 0/1 when MXP_MULTIPLE_DTM_EN is TRUE Shouping Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox