From: sashiko-bot@kernel.org
To: "Haris Okanovic" <harisokn@amazon.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 4/4] perf/arm-cmn: Convert to PERF_PMU_SCOPE_DEVICE
Date: Tue, 13 Oct 2026 19:06:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-170379@kernel.org> (raw)
In-Reply-To: <20261013185603.1347265-5-harisokn@amazon.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] perf/arm-cmn: missing hardware disable on probe error path
--
commit baed79d02fccb15f4bbc09054f99c378f1c3c918
Author: Haris Okanovic <harisokn@amazon.com>
perf/arm-cmn: Convert to PERF_PMU_SCOPE_DEVICE
This commit sets the ARM CMN PMU scope to PERF_PMU_SCOPE_DEVICE and removes
the driver-tracked cpu, hotplug hooks, and the cpumask attribute. It also
defines filter_allowed_cpus() and migrate_cpu() callbacks to keep preferences
for local NUMA node CPUs.
> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> index b162de3d9d169..00ffe45963244 100644
> --- a/drivers/perf/arm-cmn.c
> +++ b/drivers/perf/arm-cmn.c
[ ... ]
> @@ -2881,17 +2836,13 @@ static int arm_cmn_probe(struct platform_device *pdev)
> if (!name)
> return -ENOMEM;
>
> - err = cpuhp_state_add_instance(arm_cmn_hp_state, &cmn->cpuhp_node);
> + err = perf_pmu_register(&cmn->pmu, name, -1);
> if (err)
> return err;
[Severity: Medium]
If perf_pmu_register() fails here, does this return without explicitly
disabling the hardware, leaving it in an active state?
In arm_cmn_remove(), we see the driver disables the hardware:
writel_relaxed(0, cmn->dtc[0].base + CMN_DT_DTC_CTL);
Since arm_cmn_init_dtcs() was called earlier in arm_cmn_probe(), should there
be an error handling path to write 0 to CMN_DT_DTC_CTL if registration fails,
to avoid leaking hardware state?
>
> - err = perf_pmu_register(&cmn->pmu, name, -1);
> - if (err)
> - cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node);
> - else
> - arm_cmn_debugfs_init(cmn, this_id);
> + arm_cmn_debugfs_init(cmn, this_id);
>
> - return err;
> + return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013185603.1347265-1-harisokn@amazon.com?part=4
prev parent reply other threads:[~2026-10-13 19:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 18:55 [PATCH 0/4] perf: Manage single-CPU PMU affinity in perf core Haris Okanovic
2026-10-13 18:56 ` [PATCH 1/4] perf/core: Fix perf_pmu_migrate_context() leaving events behind Haris Okanovic
2026-10-13 19:06 ` sashiko-bot
2026-10-13 18:56 ` [PATCH 2/4] perf/core: Add PERF_PMU_SCOPE_DEVICE Haris Okanovic
2026-10-13 19:11 ` sashiko-bot
2026-10-13 18:56 ` [PATCH 3/4] perf/core: Allow userspace to select a device PMU's CPU Haris Okanovic
2026-10-13 19:08 ` sashiko-bot
2026-10-13 18:56 ` [PATCH 4/4] perf/arm-cmn: Convert to PERF_PMU_SCOPE_DEVICE Haris Okanovic
2026-10-13 19:06 ` sashiko-bot [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=sashiko-outbox-170379@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=harisokn@amazon.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.