From: Namhyung Kim <namhyung@kernel.org>
To: Chun-Tse Shao <ctshao@google.com>
Cc: linux-kernel@vger.kernel.org, Greg Thelen <gthelen@google.com>,
Robin Murphy <robin.murphy@arm.com>,
Tuan Phan <tuanphan@os.amperecomputing.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] perf/arm-smmuv3: Fix lockdep assert in ->event_init()
Date: Thu, 7 Nov 2024 17:23:17 -0800 [thread overview]
Message-ID: <Zy1oBfroZLBwN6Jf@google.com> (raw)
In-Reply-To: <20241107215921.3518636-1-ctshao@google.com>
On Thu, Nov 07, 2024 at 09:59:20PM +0000, Chun-Tse Shao wrote:
> Same as
> https://lore.kernel.org/all/20240514180050.182454-1-namhyung@kernel.org/,
> we should skip `for_each_sibling_event()` for group leader since it
> doesn't have the ctx yet.
>
> Fixes: f3c0eba28704 ("perf: Add a few assertions")
> Reported-by: Greg Thelen <gthelen@google.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Tuan Phan <tuanphan@os.amperecomputing.com>
> Signed-off-by: Chun-Tse Shao <ctshao@google.com>
> ---
> drivers/perf/arm_smmuv3_pmu.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
> index d5fa92ba8373..09789599fccc 100644
> --- a/drivers/perf/arm_smmuv3_pmu.c
> +++ b/drivers/perf/arm_smmuv3_pmu.c
> @@ -431,6 +431,11 @@ static int smmu_pmu_event_init(struct perf_event *event)
> return -EINVAL;
> }
>
> + hwc->idx = -1;
I think you should update the event->cpu as well.
Thanks,
Namhyung
> +
> + if (event->group_leader == event)
> + return 0;
> +
> for_each_sibling_event(sibling, event->group_leader) {
> if (is_software_event(sibling))
> continue;
> @@ -442,8 +447,6 @@ static int smmu_pmu_event_init(struct perf_event *event)
> return -EINVAL;
> }
>
> - hwc->idx = -1;
> -
> /*
> * Ensure all events are on the same cpu so all events are in the
> * same cpu context, to avoid races on pmu_enable etc.
> --
> 2.47.0.277.g8800431eea-goog
>
next prev parent reply other threads:[~2024-11-08 1:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 21:59 [PATCH] perf/arm-smmuv3: Fix lockdep assert in ->event_init() Chun-Tse Shao
2024-11-08 1:23 ` Namhyung Kim [this message]
2024-11-08 5:09 ` Chun-Tse Shao
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=Zy1oBfroZLBwN6Jf@google.com \
--to=namhyung@kernel.org \
--cc=ctshao@google.com \
--cc=gthelen@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=peterz@infradead.org \
--cc=robin.murphy@arm.com \
--cc=tuanphan@os.amperecomputing.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.