From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Yushan Wang <wangyushan12@huawei.com>
Cc: <will@kernel.org>, <mark.rutland@arm.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <prime.zeng@hisilicon.com>,
<fanghao11@huawei.com>, <linuxarm@huawei.com>,
<yangyicong@hisilicon.com>
Subject: Re: [PATCH 6/8] drivers/perf: hisi: Refactor the event configuration of L3C PMU
Date: Thu, 31 Jul 2025 13:25:38 +0100 [thread overview]
Message-ID: <20250731132538.000043a3@huawei.com> (raw)
In-Reply-To: <20250729153823.2026154-7-wangyushan12@huawei.com>
On Tue, 29 Jul 2025 23:38:21 +0800
Yushan Wang <wangyushan12@huawei.com> wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> The event register is configured using hisi_pmu::base directly since
> only one address space is supported for L3C PMU. We need to extend if
> events configuration locates in different address space. In order to
> make preparation for such hardware, extract the event register
> configuration to separate function using hw_perf_event::event_base as
> each event's base address. Implement a private
> hisi_uncore_ops::get_event_idx() callback for initialize the event_base
> besides get the hardware index.
>
> No functional changes intended.
>
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> Signed-off-by: Yushan Wang <wangyushan12@huawei.com>
One tiny thing inline.
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> ---
> drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 128 ++++++++++++-------
> 1 file changed, 83 insertions(+), 45 deletions(-)
>
> diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
> index 39444f11cbad..6ac0ea74cda3 100644
> --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
> +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
> @@ -60,51 +60,86 @@ HISI_PMU_EVENT_ATTR_EXTRACTOR(datasrc_cfg, config1, 15, 11);
> HISI_PMU_EVENT_ATTR_EXTRACTOR(datasrc_skt, config1, 16, 16);
> HISI_PMU_EVENT_ATTR_EXTRACTOR(tt_core, config2, 15, 0);
>
> -static void hisi_l3c_pmu_config_req_tracetag(struct perf_event *event)
> +static int hisi_l3c_pmu_get_event_idx(struct perf_event *event)
> {
> struct hisi_pmu *l3c_pmu = to_hisi_pmu(event->pmu);
> + unsigned long *used_mask = l3c_pmu->pmu_events.used_mask;
> + u32 num_counters = l3c_pmu->num_counters;
> + int idx;
> +
> + idx = find_first_zero_bit(used_mask, num_counters);
> + if (idx == num_counters)
> + return -EAGAIN;
> +
> + set_bit(idx, used_mask);
> + event->hw.event_base = (unsigned long)l3c_pmu->base;
Trivial but blank line here.
> + return idx;
> +}
next prev parent reply other threads:[~2025-07-31 12:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 15:38 [PATCH 0/8] Updates of HiSilicon Uncore " Yushan Wang
2025-07-29 15:38 ` [PATCH 1/8] drivers/perf: hisi: Relax the event ID check in the framework Yushan Wang
2025-07-31 12:15 ` Jonathan Cameron
2025-07-29 15:38 ` [PATCH 2/8] drivers/perf: hisi: Export hisi_uncore_pmu_isr() Yushan Wang
2025-07-31 12:15 ` Jonathan Cameron
2025-07-29 15:38 ` [PATCH 3/8] drivers/perf: hisi: Simplify the probe process of each L3C PMU version Yushan Wang
2025-07-31 12:17 ` Jonathan Cameron
2025-07-29 15:38 ` [PATCH 4/8] drivers/perf: hisi: Extract the event filter check of L3C PMU Yushan Wang
2025-07-31 12:20 ` Jonathan Cameron
2025-07-29 15:38 ` [PATCH 5/8] drivers/perf: hisi: Extend the field of tt_core Yushan Wang
2025-07-31 12:21 ` Jonathan Cameron
2025-07-29 15:38 ` [PATCH 6/8] drivers/perf: hisi: Refactor the event configuration of L3C PMU Yushan Wang
2025-07-31 12:25 ` Jonathan Cameron [this message]
2025-07-29 15:38 ` [PATCH 7/8] drivers/perf: hisi: Add support for L3C PMU v3 Yushan Wang
2025-07-31 12:45 ` Jonathan Cameron
2025-07-29 15:38 ` [PATCH 8/8] Documentation: hisi-pmu: Add introduction to HiSilicon V3 PMU Yushan Wang
2025-07-31 12:47 ` Jonathan Cameron
2025-08-01 9:49 ` Yicong Yang
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=20250731132538.000043a3@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=fanghao11@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=prime.zeng@hisilicon.com \
--cc=wangyushan12@huawei.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®