From: sashiko-bot@kernel.org
To: "Detlev Casanova" <detlev.casanova@collabora.com>
Cc: linux-trace-kernel@vger.kernel.org, media-ci@linuxtv.org
Subject: Re: [PATCH v4 9/9] media: hantro: Add v4l2_hw run/done traces
Date: Fri, 27 Nov 2026 17:07:51 +0000 [thread overview]
Message-ID: <sashiko-outbox-237963@kernel.org> (raw)
In-Reply-To: <20261127-v4l2-add-ftrace-v4-9-24138479002f@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] media: hantro: spurious v4l2_hw_run trace in
hantro_end_prepare_run()
--
commit 1ae655efcf68c0a93d5323d8fc7f3881bf26bec6
Author: Detlev Casanova <detlev.casanova@collabora.com>
media: hantro: Add v4l2_hw run/done traces
This commit adds trace_v4l2_hw_run() and trace_v4l2_hw_done() calls to the
Hantro VPU driver and records the hardware cycle count on the Rockchip
VPU981 AV1 decoder.
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index 3734ea701145a..45bf926c0480d 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
[ ... ]
> @@ -159,6 +165,8 @@ void hantro_end_prepare_run(struct hantro_ctx *ctx)
> v4l2_ctrl_request_complete(src_buf->vb2_buf.req_obj.req,
> &ctx->ctrl_handler);
>
> + trace_v4l2_hw_run(ctx->fh.tgid, ctx->fh.fd);
> +
> /* Kick the watchdog. */
> schedule_delayed_work(&ctx->dev->watchdog_work,
> msecs_to_jiffies(2000));
[Severity: Low]
Will calling trace_v4l2_hw_run() inside hantro_end_prepare_run() emit
v4l2_hw_run events even when frame preparation fails and the hardware is
never started?
For example, rockchip_vpu981_av1_dec_run() calls hantro_end_prepare_run()
on its error path before returning without enabling the decoder:
drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:rockchip_vpu981_av1_dec_run() {
...
hantro_end_prepare_run(ctx);
hantro_reg_write(vpu, &av1_dec_e, 1);
return 0;
prepare_error:
hantro_end_prepare_run(ctx);
hantro_irq_done(vpu, VB2_BUF_STATE_ERROR);
return ret;
}
When rockchip_vpu981_av1_dec_prepare_run() fails (such as on an invalid
tile count), this emits both trace_v4l2_hw_run() and trace_v4l2_hw_done()
even though no job ran on the hardware. Similarly, hantro_g2_vp9_dec_run()
and rockchip_vpu2_vp8_dec_run() call hantro_end_prepare_run() when
start_prepare_run() fails and return an error to device_run(), which emits
an unpaired trace_v4l2_hw_run() without a matching trace_v4l2_hw_done().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261127-v4l2-add-ftrace-v4-0-24138479002f@collabora.com?part=9
prev parent reply other threads:[~2026-11-27 17:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 16:45 [PATCH v4 0/9] v4l2: Add tracing for stateless codecs Detlev Casanova
2026-11-27 16:45 ` [PATCH v4 1/9] media: Move visl traces to v4l2-core Detlev Casanova
2026-11-27 16:45 ` [PATCH v4 2/9] media: Map each struct field to its own trace field Detlev Casanova
2026-11-27 16:45 ` [PATCH v4 3/9] media: Add tgid and fd fields in v4l2_fh struct Detlev Casanova
2026-11-27 16:57 ` sashiko-bot
2026-11-27 16:45 ` [PATCH v4 4/9] media: Add tgid and fd to the v4l2-requests trace fields Detlev Casanova
2026-11-27 16:45 ` [PATCH v4 5/9] media: Add missing types to v4l2_ctrl_ptr Detlev Casanova
2026-11-27 16:45 ` [PATCH v4 6/9] media: Trace the stateless controls when set in v4l2-ctrls-core.c Detlev Casanova
2026-11-27 17:04 ` sashiko-bot
2026-11-27 16:45 ` [PATCH v4 7/9] media: Add stream on/off traces and run them in the ioctl Detlev Casanova
2026-11-27 16:45 ` [PATCH v4 8/9] media: Add HW run/done trace events Detlev Casanova
2026-11-27 16:45 ` [PATCH v4 9/9] media: hantro: Add v4l2_hw run/done traces Detlev Casanova
2026-11-27 17:07 ` 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-237963@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=detlev.casanova@collabora.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=media-ci@linuxtv.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