From: sashiko-bot@kernel.org
To: "Vikram Singh" <vikram.singh3@oss.qualcomm.com>
Cc: linux-perf-users@vger.kernel.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 4/7] riscv: pmu: Add infrastructure for Control Transfer Record
Date: Wed, 18 Nov 2026 10:09:24 +0000 [thread overview]
Message-ID: <sashiko-outbox-220656@kernel.org> (raw)
In-Reply-To: <20261118095053.3871267-5-vikram.singh3@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] riscv: pmu: incompatible event_init() pointer type and ignored
return value
--
commit 7e8e6b1d16d64b45e5fbc2ee239b9a0170cb2964
Author: Vikram Singh <vikram.singh3@oss.qualcomm.com>
riscv: pmu: Add infrastructure for Control Transfer Record
This commit adds branch stack sampling data structures and PMU callbacks
to struct riscv_pmu and struct cpu_hw_events to prepare for Control
Transfer Records (CTR) support.
Link: https://lore.kernel.org/r/20261106173942.3175069-5-vikram.singh3@oss.qualcomm.com
> diff --git a/include/linux/perf/riscv_pmu.h b/include/linux/perf/riscv_pmu.h
> index ecaa40370830a..c748a06ad7514 100644
> --- a/include/linux/perf/riscv_pmu.h
> +++ b/include/linux/perf/riscv_pmu.h
[ ... ]
> @@ -60,17 +74,22 @@ struct riscv_pmu {
> int (*ctr_get_idx)(struct perf_event *event);
> int (*ctr_get_width)(int idx);
> void (*ctr_clear_idx)(struct perf_event *event);
> + void (*ctr_add)(struct perf_event *event, int flags);
> + void (*ctr_del)(struct perf_event *event, int flags);
> void (*ctr_start)(struct perf_event *event, u64 init_val);
> void (*ctr_stop)(struct perf_event *event, unsigned long flag);
> int (*event_map)(struct perf_event *event, u64 *config);
> - void (*event_init)(struct perf_event *event);
> + int (*event_init)(struct perf_event *event);
[Severity: High]
Does changing the return type of struct riscv_pmu::event_init here break
the build with -Werror=incompatible-pointer-types when CONFIG_RISCV_PMU_SBI
is enabled?
In this commit, pmu_sbi_event_init() in drivers/perf/riscv_pmu_sbi.c still
returns void while pmu_sbi_device_probe() assigns it to pmu->event_init;
its signature is only updated in a later patch in the series, commit
"riscv: pmu: Integrate CTR Ext support in riscv_pmu_dev driver", breaking
bisection.
In addition, riscv_pmu_event_init() in drivers/perf/riscv_pmu.c calls
rvpmu->event_init(event) without checking or returning its int result, so
initialization errors from the backend callback are silently ignored.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118095053.3871267-1-vikram.singh3@oss.qualcomm.com?part=4
next prev parent reply other threads:[~2026-11-18 10:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 9:50 [PATCH v5 0/7] riscv: pmu: Add support for Control Transfer Records Ext Vikram Singh
2026-11-18 9:50 ` [PATCH v5 1/7] perf: Increase the maximum number of branches remove_loops() can process Vikram Singh
2026-11-18 9:50 ` [PATCH v5 2/7] riscv: pmu: Add Control transfer records CSR definations Vikram Singh
2026-11-18 10:00 ` sashiko-bot
2026-11-18 9:50 ` [PATCH v5 3/7] riscv: Add Control Transfer Records extension parsing Vikram Singh
2026-11-18 10:02 ` sashiko-bot
2026-11-18 9:50 ` [PATCH v5 4/7] riscv: pmu: Add infrastructure for Control Transfer Record Vikram Singh
2026-11-18 10:09 ` sashiko-bot [this message]
2026-11-18 9:50 ` [PATCH v5 5/7] riscv: pmu: Add driver for Control Transfer Records Ext Vikram Singh
2026-11-18 9:50 ` [PATCH v5 6/7] riscv: pmu: Integrate CTR Ext support in riscv_pmu_dev driver Vikram Singh
2026-11-18 9:50 ` [PATCH v5 7/7] dt-bindings: riscv: add Sxctr ISA extension description Vikram Singh
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-220656@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vikram.singh3@oss.qualcomm.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