Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wenmeng Liu" <wenmeng.liu@oss.qualcomm.com>
Cc: media-ci@linuxtv.org, conor+dt@kernel.org, robh@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 3/6] media: qcom: camss: vfe: Add support for VFE gen4
Date: Tue, 15 Sep 2026 09:53:26 +0000	[thread overview]
Message-ID: <20260915095327.418B91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915-nord-v1-3-20db41a7f1ff@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] media: camss: vfe: AUP_UPDATE hardware desync when queued buffers < 2
--

commit 6e9773967fcca20f990885a6e668a47fa226cbc5
Author: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>

media: qcom: camss: vfe: Add support for VFE gen4

This commit adds support for the VFE Gen4 module on the Kaanapali SoC. It 
limits early register updates for Kaanapali, as it requires updates to be 
issued only after all CSID configuration completes.

> diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
> --- a/drivers/media/platform/qcom/camss/camss-vfe.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe.c

[ ... ]

> @@ -552,7 +553,9 @@ int vfe_enable_output_v2(struct vfe_line *line)
>  		output->gen2.active_num++;
>  		ops->vfe_wm_update(vfe, output->wm_idx[0],
>  				   output->buf[i]->addr[0], line);
> -		ops->reg_update(vfe, line->id);
> +
> +		if (!vfe->res->reg_update_after_csid_config)
> +			ops->reg_update(vfe, line->id);

[Severity: High]
Does this cause a hardware desynchronization if fewer than two buffers are
queued before stream-on?

Since min_queued_buffers is 0, V4L2 userspace can queue 0 or 1 buffers
before starting the stream. When vfe_enable_output_v2() skips the
reg_update() here, CSID blindly issues CAMSS_INIT_BUF_COUNT (2) AUP_UPDATEs
during csid_configure_stream().

If the remaining buffers are queued later, vfe_queue_buffer_v2() will issue
an additional reg_update():

drivers/media/platform/qcom/camss/camss-vfe.c:vfe_queue_buffer_v2() {
...
	ops->vfe_wm_update(vfe, output->wm_idx[0], output->buf[1]->addr[0], line);
	ops->reg_update(vfe, line->id);
...
}

This pushes the AUP_UPDATE count to 3 for 2 buffers, which corrupts the
hardware state.

Additionally, if 0 buffers were queued initially, vfe_queue_buffer_v2()
places the newly queued buffer unconditionally in output->buf[1] instead of
buf[0]. When the hardware completes the frame, vfe_buf_done() expects buf[0]
to be valid, leading to a missing ready buf error and leaking the buffer.

>  	}
>  
>  	spin_unlock_irqrestore(&vfe->output_lock, flags);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915-nord-v1-0-20db41a7f1ff@oss.qualcomm.com?part=3

  reply	other threads:[~2026-09-15  9:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  9:34 [PATCH 0/6] media: qcom: camss: Add support for Nord CAMSS Wenmeng Liu
2026-09-15  9:34 ` [PATCH 1/6] dt-bindings: media: Add bindings for qcom,nord-camss Wenmeng Liu
2026-09-15  9:45   ` sashiko-bot
2026-09-17 10:13   ` Krzysztof Kozlowski
2026-09-17 12:37     ` Wenmeng Liu
2026-09-18  6:47       ` Krzysztof Kozlowski
2026-09-18  7:08         ` Wenmeng Liu
2026-09-15  9:34 ` [PATCH 2/6] media: qcom: camss: csid: Add support for CSID 900 Wenmeng Liu
2026-09-15  9:50   ` sashiko-bot
2026-09-20  7:01   ` Shawn Guo
2026-09-15  9:34 ` [PATCH 3/6] media: qcom: camss: vfe: Add support for VFE gen4 Wenmeng Liu
2026-09-15  9:53   ` sashiko-bot [this message]
2026-09-20  7:19   ` Shawn Guo
2026-09-15  9:34 ` [PATCH 4/6] media: qcom: camss: vfe: Add support for VFE 900 Wenmeng Liu
2026-09-15  9:43   ` sashiko-bot
2026-09-20  7:17   ` Shawn Guo
2026-09-15  9:34 ` [PATCH 5/6] media: qcom: camss: tpg: Add support for TPG v2.5.0 Wenmeng Liu
2026-09-15  9:34 ` [PATCH 6/6] media: qcom: camss: Add support for nord camss Wenmeng Liu

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=20260915095327.418B91F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wenmeng.liu@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