All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephane Eranian <eranian@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] perf/arm-cmn: Fix arm_cmn_node_to_xp()
Date: Wed, 20 Nov 2024 10:44:50 -0800	[thread overview]
Message-ID: <Zz4uIoYS0fhJZTi3@google.com> (raw)
In-Reply-To: <bb01b83a-32cb-4efe-b9d6-06a4cf138b3b@arm.com>

Hello,

On Wed, Nov 20, 2024 at 04:55:04PM +0000, Robin Murphy wrote:
> 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?

Yep, this looks good to me too.  Do you want to me to resend this?

Thanks,
Namhyung

> 
> ----->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:


      reply	other threads:[~2024-11-20 18:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 16:41 [PATCH] perf/arm-cmn: Fix arm_cmn_node_to_xp() Namhyung Kim
2024-11-20 16:55 ` Robin Murphy
2024-11-20 18:44   ` Namhyung Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zz4uIoYS0fhJZTi3@google.com \
    --to=namhyung@kernel.org \
    --cc=eranian@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.