[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb01b83a-32cb-4efe-b9d6-06a4cf138b3b@arm.com>
Date: Wed, 20 Nov 2024 16:55:04 +0000
From: Robin Murphy <robin.murphy@....com>
To: Namhyung Kim <namhyung@...nel.org>, Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>
Cc: Stephane Eranian <eranian@...gle.com>, LKML
<linux-kernel@...r.kernel.org>, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] perf/arm-cmn: Fix arm_cmn_node_to_xp()
On 20/11/2024 4:41 pm, Namhyung Kim wrote:
> The portid_bits and deviceid_bits for XP type nodes are set in the
> arm_cmn_discover() and it's copied to others in arm_cmn_init_dtcs().
> But to get the XP from a node in the arm_cmn_init_dtcs(), it needs
> the {port,device}id_bits.
>
> This makes arm-cmn PMU failing to count events on my setup. What we
> need is the number of bits in total which is known by the cmn config.
Hmm, what about just moving the assignment to a point where it actually
makes more sense anyway?
Cheers,
Robin.
----->8-----
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 397a46410f7c..30506c43776f 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -2178,8 +2178,6 @@ static int arm_cmn_init_dtcs(struct arm_cmn *cmn)
continue;
xp = arm_cmn_node_to_xp(cmn, dn);
- dn->portid_bits = xp->portid_bits;
- dn->deviceid_bits = xp->deviceid_bits;
dn->dtc = xp->dtc;
dn->dtm = xp->dtm;
if (cmn->multi_dtm)
@@ -2420,6 +2418,8 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
}
arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn);
+ dn->portid_bits = xp->portid_bits;
+ dn->deviceid_bits = xp->deviceid_bits;
switch (dn->type) {
case CMN_TYPE_DTC:
Powered by blists - more mailing lists