Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kyrie Wu" <kyrie.wu@mediatek.com>, devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org, media-ci@linuxtv.org
Subject: Re: [PATCH v19 06/13] media: mediatek: jpeg: fix buffer state update timing
Date: Mon, 16 Nov 2026 01:52:46 +0000	[thread overview]
Message-ID: <sashiko-outbox-216017@kernel.org> (raw)
In-Reply-To: <20261116013402.1273016-7-kyrie.wu@mediatek.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] media: mediatek: jpeg: inaccurate done-queue commit log and
  missing Fixes tags
--

commit f59ad92b8e09a13f32b7826bdddbfafbfe79fb42
Author: Kyrie Wu <kyrie.wu@mediatek.com>

> media: mediatek: jpeg: fix buffer state update timing
>
> Publish destination context and frame tracking metadata only after the
> decoder has selected a hardware core, resumed runtime PM, and prepared
> the destination. Publish it before arming the timeout or starting hardware
> so completion observes initialized state.
>
> Stop walking the done queue after completing the next expected frame;
> remaining buffers must wait for their own frame order.
>
> Fixes: dedc21500334 ("media: mtk-jpegdec: add jpeg decode worker interface")
> Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

[Severity: Low]
Is the second paragraph of the commit message accurate about what the added
break statement does in mtk_jpegdec_put_buf() and mtk_jpegenc_put_buf()?

In both functions, list_for_each_prev_safe() is nested inside an outer loop
that checks pos != &ctx->dst_done_queue:

drivers/media/platform/mediatek/jpeg/mtk_jpeg_dec_hw.c:mtk_jpegdec_put_buf() {
	...
	while (!list_empty(&ctx->dst_done_queue) &&
	       (pos != &ctx->dst_done_queue)) {
		list_for_each_prev_safe(pos, temp_entry, &ctx->dst_done_queue) {
	...
}

Without the break, list_for_each_prev_safe() always ran until pos reached
&ctx->dst_done_queue, ending the outer while loop after a single reverse
pass even if frame N+1 was already queued behind frame N.  Breaking out of
the inner loop while pos != &ctx->dst_done_queue causes the outer while
loop to restart the scan from the tail of dst_done_queue for the
incremented last_done_frame_num, completing consecutive ready frames rather
than stopping the walk.

Also, since the patch fixes the done-queue loops in mtk_jpegdec_put_buf()
and mtk_jpegenc_put_buf() as well as the ctx->total_frame_num increment
placement in mtk_jpegdec_worker(), should it include the following Fixes
tags in addition to dedc21500334 ("media: mtk-jpegdec: add jpeg decode
worker interface")?

  Fixes: 7915282498e3 ("media: mtk-jpegdec: add output pic reorder interface")
  Fixes: 841a58decd87 ("mtk-jpegenc: add output pic reorder interface")
  Fixes: 52f68114857f ("media: mtk-jpegdec: refactor jpegdec func interface")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116013402.1273016-1-kyrie.wu@mediatek.com?part=6

  reply	other threads:[~2026-11-16  1:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  1:33 [PATCH v19 00/13] media: mediatek: jpeg: add MT8196 JPEG support Kyrie Wu
2026-11-16  1:33 ` [PATCH v19 01/13] media: mediatek: jpeg: fix jpeg cores' amounts setting Kyrie Wu
2026-11-16  1:48   ` sashiko-bot
2026-11-16  1:33 ` [PATCH v19 02/13] media: mediatek: jpeg: fix jpeg buffer payload size setting Kyrie Wu
2026-11-16  1:33 ` [PATCH v19 03/13] media: mediatek: jpeg: fix buffer structure size and layout Kyrie Wu
2026-11-16  1:33 ` [PATCH v19 04/13] media: mediatek: jpeg: Fix buffer completion on multi-core streaming stop Kyrie Wu
2026-11-16  1:33 ` [PATCH v19 05/13] media: mediatek: jpeg: Fix multi-core clk suspend and resume setting Kyrie Wu
2026-11-16  2:03   ` sashiko-bot
2026-11-16  1:33 ` [PATCH v19 06/13] media: mediatek: jpeg: fix buffer state update timing Kyrie Wu
2026-11-16  1:52   ` sashiko-bot [this message]
2026-11-16  1:33 ` [PATCH v19 07/13] media: mediatek: jpeg: fix resolution change event handling in decoder Kyrie Wu
2026-11-16  1:55   ` sashiko-bot
2026-11-16  1:33 ` [PATCH v19 08/13] media: mediatek: jpeg: fix remove buffer removal timing for multi-core Kyrie Wu
2026-11-16  1:33 ` [PATCH v19 09/13] dt-bindings: soc: mediatek: Add MT8196 JPEG SMMU Kyrie Wu
2026-11-16  1:52   ` sashiko-bot
2026-11-16  1:33 ` [PATCH v19 10/13] media: dt-bindings: mediatek,jpeg: Add mediatek, mt8196-jpgdec compatible Kyrie Wu
2026-11-16  1:33 ` [PATCH v19 11/13] media: dt-bindings: mediatek,jpeg: Add mediatek, mt8196-jpgenc compatible Kyrie Wu
2026-11-16  1:33 ` [PATCH v19 12/13] media: mediatek: jpeg: add jpeg compatible Kyrie Wu
2026-11-16  2:04   ` sashiko-bot
2026-11-16  1:33 ` [PATCH v19 13/13] media: mediatek: jpeg: add jpeg smmu sid setting Kyrie Wu
2026-11-16  2:04   ` 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-216017@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kyrie.wu@mediatek.com \
    --cc=media-ci@linuxtv.org \
    --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