Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mayuresh Chitale" <mayuresh.chitale@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v6 06/14] gtrace: Add RISC-V Trace encoder driver
Date: Thu, 01 Oct 2026 05:34:34 +0000	[thread overview]
Message-ID: <20261001053434.A2A681F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261001052243.3042627-7-mayuresh.chitale@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] gtrace: missing INHIBITSRC restore in rvtrace_encoder_start()
--

commit 89ac751d2a47352255588950ac5d611d8f1d501f
Author: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>

gtrace: Add RISC-V Trace encoder driver

This commit adds the initial implementation of the RISC-V E-Trace encoder
driver. The encoder generates trace data for its bound CPU as defined in the
RISC-V Trace Control Interface specification.

> diff --git a/drivers/hwtracing/gtrace/rvtrace-encoder.c b/drivers/hwtracing/gtrace/rvtrace-encoder.c
> new file mode 100644
> index 0000000000000..1f06b1a2b4128
> --- /dev/null
> +++ b/drivers/hwtracing/gtrace/rvtrace-encoder.c

[ ... ]

> +static int rvtrace_encoder_start(struct gtrace_component *comp)
> +{
> +	struct rvtrace_encoder_priv *priv = dev_get_drvdata(&comp->dev);
> +	struct gtrace_platform_data *pdata = comp->pdata;
> +	int ret;
> +	u32 val;
> +
> +	if (priv->srcbits)
> +		rvtrace_encoder_set_srcid(pdata, priv->srcbits);
> +
> +	ret = rvtrace_encoder_set_format(pdata);

[Severity: Medium]
Does this skip restoring the INHIBITSRC bit when priv->srcbits is 0?

If the device loses context (for example, during power state changes when the
component is disabled and re-enabled) and tracing is started on a CPU where
source ID tracing is unsupported, could the hardware emit trace packets with
uninitialized or garbage source IDs?

During rvtrace_encoder_probe(), INHIBITSRC is explicitly set when
priv->srcbits is 0:

	if (!priv->srcbits) {
		...
		val = gtrace_read32(pdata, RVTRACE_COMPONENT_CTRL_OFFSET);
		val |= BIT(RVTRACE_COMPONENT_CTRL_INHIBITSRC_SHIFT);
		gtrace_write32(pdata, val, RVTRACE_COMPONENT_CTRL_OFFSET);
	}

Should rvtrace_encoder_start() also restore this state to ensure complete
hardware state initialization?

> +	if (ret) {
> +		dev_err(&comp->dev, "failed to set format %d\n", pdata->format);
> +		return ret;
> +	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261001052243.3042627-1-mayuresh.chitale@oss.qualcomm.com?part=6

  reply	other threads:[~2026-10-01  5:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01  5:22 [PATCH v6 00/14] Linux RISC-V trace framework and drivers Mayuresh Chitale
2026-10-01  5:22 ` [PATCH v6 01/14] dt-bindings: Add RISC-V trace component bindings Mayuresh Chitale
2026-10-01  5:33   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 02/14] hwtracing: gtrace: Initial implementation of gtrace framework Mayuresh Chitale
2026-10-01  5:37   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 03/14] gtrace: Add RISC-V platform driver for the " Mayuresh Chitale
2026-10-01  5:36   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 04/14] gtrace: Add functions to create/destroy a trace component path Mayuresh Chitale
2026-10-01  5:36   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 05/14] gtrace: Add functions to start/stop tracing on a " Mayuresh Chitale
2026-10-01  5:36   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 06/14] gtrace: Add RISC-V Trace encoder driver Mayuresh Chitale
2026-10-01  5:34   ` sashiko-bot [this message]
2026-10-01  5:22 ` [PATCH v6 07/14] gtrace: Add function to copy into perf AUX buffer Mayuresh Chitale
2026-10-01  5:40   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 08/14] perf: Add gtrace AUX buffer trace format type Mayuresh Chitale
2026-10-01  5:22 ` [PATCH v6 09/14] gtrace: Add RISC-V Trace ramsink driver Mayuresh Chitale
2026-10-01  5:42   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 10/14] riscv: Enable DMA_RESTRICTED_POOL in defconfig Mayuresh Chitale
2026-10-01  5:22 ` [PATCH v6 11/14] gtrace: Add perf driver for tracing using perf tool Mayuresh Chitale
2026-10-01  5:44   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 12/14] perf tools: Add RISC-V trace PMU record capabilities Mayuresh Chitale
2026-10-01  5:22 ` [PATCH v6 13/14] perf tools: Initial support for gtrace decoder Mayuresh Chitale
2026-10-01  5:35   ` sashiko-bot
2026-10-01  5:22 ` [PATCH v6 14/14] MAINTAINERS: Add entry for RISC-V trace framework Mayuresh Chitale

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=20261001053434.A2A681F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=mayuresh.chitale@oss.qualcomm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox