From: sashiko-bot@kernel.org
To: "Leo Yu-Chi Liang" <leo.liang@sifive.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 07/10] gtrace: rvtrace: Add pre-ratified trace funnel driver
Date: Thu, 26 Nov 2026 09:19:33 +0000 [thread overview]
Message-ID: <sashiko-outbox-235114@kernel.org> (raw)
In-Reply-To: <20261126-send-preratified-trace-v1-7-1e686fd75be7@sifive.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] gtrace: rvtrace: missing tristate RVTRACE dependency on
RVTRACE_FUNNEL
- [Medium] gtrace: rvtrace: premature hardware enable in
rvtrace_funnel_probe()
--
commit d12b4752379ea0c92ba55f2e57ceaa616a25b3e8
Author: Eric Lin <eric.lin@sifive.com>
gtrace: rvtrace: Add pre-ratified trace funnel driver
This commit adds a gtrace driver for the pre-ratified RISC-V trace funnel
component.
> diff --git a/drivers/hwtracing/gtrace/Kconfig b/drivers/hwtracing/gtrace/Kconfig
> index b1f9ca8f73cb9..66fc2791d8f4e 100644
> --- a/drivers/hwtracing/gtrace/Kconfig
> +++ b/drivers/hwtracing/gtrace/Kconfig
> @@ -43,6 +43,19 @@ config RVTRACE_ENCODER
> To compile this driver as a module, choose M here: the module
> will be called rvtrace-encoder.
>
> +config RVTRACE_FUNNEL
> + tristate "RISC-V Trace Funnel driver"
> + depends on RVTRACE_V0
> + default y
[Severity: Medium]
Should RVTRACE_FUNNEL also depend on RVTRACE?
Because RVTRACE_V0 is a bool symbol while RVTRACE is a tristate symbol,
CONFIG_RVTRACE=m sets CONFIG_RVTRACE_V0=y and allows CONFIG_RVTRACE_FUNNEL=y.
In that configuration, built-in rvtrace-funnel.o fails to link against
rvtrace_v0_sink_config() in rvtrace.ko (and gtrace core symbols when
CONFIG_GTRACE=m).
> diff --git a/drivers/hwtracing/gtrace/rvtrace-funnel.c b/drivers/hwtracing/gtrace/rvtrace-funnel.c
> new file mode 100644
> index 0000000000000..2e0843d233ab7
> --- /dev/null
> +++ b/drivers/hwtracing/gtrace/rvtrace-funnel.c
> @@ -0,0 +1,98 @@
[ ... ]
> +static int rvtrace_funnel_start(struct gtrace_path_node *node)
> +{
> + struct gtrace_component *comp = node->comp;
> + int ret;
> +
> + /* Set pre-ratified comp's next sink */
> + ret = rvtrace_v0_sink_config(node);
> + if (ret) {
> + dev_err(&comp->dev, "failed to set next sink.\n");
> + return ret;
> + }
> +
> + ret = gtrace_enable_component(comp);
> + if (ret)
> + dev_err(&comp->dev, "failed to enable funnel.\n");
> +
> + return ret;
> +}
> +
> +static int rvtrace_funnel_stop(struct gtrace_component *comp)
> +{
> + int ret;
> +
> + ret = gtrace_disable_component(comp);
> + if (ret) {
> + dev_err(&comp->dev, "failed to disable funnel.\n");
> + return ret;
> + }
> +
> + return rvtrace_comp_poll_empty(comp);
> +}
> +
> +static int rvtrace_funnel_probe(struct gtrace_component *comp)
> +{
> + int ret;
> +
> + ret = gtrace_enable_component(comp);
> + if (ret)
> + return dev_err_probe(&comp->dev, ret, "failed to enable funnel.\n");
> +
> + return 0;
> +}
> +
> +static void rvtrace_funnel_remove(struct gtrace_component *comp)
> +{
> + int ret;
> +
> + ret = gtrace_disable_component(comp);
> + if (ret)
> + dev_err(&comp->dev, "failed to disable funnel.\n");
> +}
[Severity: Medium]
Why do rvtrace_funnel_probe() and rvtrace_funnel_remove() enable and disable
the funnel component?
rvtrace_platform_probe() already resets the component and brings it out of
reset before registering it, and rvtrace_funnel_start() and
rvtrace_funnel_stop() enable and disable it around each trace session.
Enabling the component in rvtrace_funnel_probe() leaves the funnel enabled
while idle after boot before any output sink is configured, causes
rvtrace_v0_sink_config() to modify the sink bits in
RVTRACE_COMPONENT_CTRL_OFFSET while the funnel is already enabled on the
first trace run, and leaves the funnel disabled after the first trace session
stops.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126-send-preratified-trace-v1-0-1e686fd75be7@sifive.com?part=7
next prev parent reply other threads:[~2026-11-26 9:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 9:07 [PATCH 00/10] gtrace: Add support for SiFive pre-ratified RISC-V trace components Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 01/10] dt-bindings: riscv: Add SiFive pre-ratified " Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 02/10] gtrace: rvtrace: Add pre-ratified implementation callback Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 03/10] gtrace: rvtrace: Add pre-ratified private data callback Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 04/10] gtrace: rvtrace: Add pre-ratified encoder support Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 05/10] gtrace: Terminate id_table iteration on GTRACE_COMPONENT_TYPE_NONE Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 06/10] gtrace: rvtrace: Add pre-ratified trace sink config Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 07/10] gtrace: rvtrace: Add pre-ratified trace funnel driver Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:19 ` sashiko-bot [this message]
2026-11-26 9:07 ` [PATCH 08/10] gtrace: rvtrace: Introduce struct rvtrace_ramsink_regs to abstract register offsets Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:07 ` [PATCH 09/10] gtrace: rvtrace: Add pre-ratified ramsink setup Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:19 ` sashiko-bot
2026-11-26 9:07 ` [PATCH 10/10] gtrace: rvtrace: Add copyto_auxbuf callback for pre-ratified encoder and funnel Leo Yu-Chi Liang
2026-11-26 9:07 ` Leo Yu-Chi Liang
2026-11-26 9:32 ` sashiko-bot
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-235114@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=leo.liang@sifive.com \
--cc=robh@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.