Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hangxiang Ma" <hangxiang.ma@oss.qualcomm.com>
Cc: krzk+dt@kernel.org, devicetree@vger.kernel.org,
	conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v13 5/5] media: qcom: camss: vfe: Add support for VFE gen4
Date: Fri, 08 May 2026 21:56:39 +0000	[thread overview]
Message-ID: <20260508215640.5ED64C2BCF4@smtp.kernel.org> (raw)
In-Reply-To: <20260508-kaanapali-camss-v13-5-2541d8e55651@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Hardware constraint violation due to AUP_UPDATE and enqueued buffer count mismatch on Kaanapali.
--

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

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

Add Video Front End (VFE) version gen4 as found on the Kaanapali SoC.

> diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
> index 5baf0e3d4bc46..99630ffa1db57 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe.c

[ ... ]

> @@ -551,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);
>  	}
>  
>  	spin_unlock_irqrestore(&vfe->output_lock, flags);

Does this implementation violate the Kaanapali hardware constraint regarding
AUP_UPDATE and enqueued buffer count?

The commit message explicitly states that Kaanapali hardware requires the
number of AUP_UPDATE commands to exactly match the number of buffers enqueued
to the write master while it is being enabled.

During STREAMON, VFE dynamically enqueues between 0 and 2 pending buffers
(up to CAMSS_INIT_BUF_COUNT) depending on what userspace has queued. It
skips issuing the VFE register update here because
reg_update_after_csid_config is true.

However, csid_configure_stream() in the CSID driver executes and
unconditionally issues exactly 2 AUP_UPDATEs via a hardcoded loop
(for (k = 0; k < CAMSS_INIT_BUF_COUNT; k++) __csid_aup_update()), completely
ignoring the actual active_num of buffers the VFE enqueued.

Furthermore, if userspace queued fewer than 2 buffers before STREAMON and
queues the remaining buffers later via VIDIOC_QBUF, vfe_queue_buffer_v2()
sees active_num < 2 and unconditionally issues an additional ops->reg_update()
per buffer.

For example, if userspace queues 0 buffers initially, CSID blindly issues
2 AUP_UPDATEs. When 2 buffers are subsequently queued via QBUF,
vfe_queue_buffer_v2() issues 2 more, resulting in 4 AUP_UPDATEs for 2 buffers.

Could this mismatch between AUP_UPDATEs and enqueued buffers cause
desynchronization in the state machine, FIFO underflows, or IOMMU faults?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260508-kaanapali-camss-v13-0-2541d8e55651@oss.qualcomm.com?part=5

      reply	other threads:[~2026-05-08 21:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08  8:05 [PATCH v13 0/5] media: qcom: camss: Add Kaanapali support Hangxiang Ma
2026-05-08  8:05 ` [PATCH v13 1/5] media: dt-bindings: Add CAMSS device for Kaanapali Hangxiang Ma
2026-05-08  8:05 ` [PATCH v13 2/5] media: qcom: camss: Add Kaanapali compatible camss driver Hangxiang Ma
2026-05-08 20:33   ` sashiko-bot
2026-05-08  8:05 ` [PATCH v13 3/5] media: qcom: camss: csiphy: Add support for v2.4.0 two-phase CSIPHY Hangxiang Ma
2026-05-08  8:05 ` [PATCH v13 4/5] media: qcom: camss: csid: Add support for CSID gen4 Hangxiang Ma
2026-05-08 21:22   ` sashiko-bot
2026-05-08  8:05 ` [PATCH v13 5/5] media: qcom: camss: vfe: Add support for VFE gen4 Hangxiang Ma
2026-05-08 21:56   ` 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=20260508215640.5ED64C2BCF4@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hangxiang.ma@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko@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