Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hangxiang Ma" <hangxiang.ma@oss.qualcomm.com>
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, media-ci@linuxtv.org,
	vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v23 10/15] media: qcom: camss: vfe: Add support for VFE 1080
Date: Wed, 28 Oct 2026 15:34:55 +0000	[thread overview]
Message-ID: <sashiko-outbox-188058@kernel.org> (raw)
In-Reply-To: <20261028-kaanapali-camss-v23-10-95f250b18612@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] media: qcom: camss: unsynchronized CSID RUP/AUP updates in vfe_ops_1080
--

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

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

This commit adds support for the VFE 1080 hardware block found on the
Kaanapali SoC, including write master configuration, CSID register and
address update forwarding, and Kaanapali VFE resource definitions.

> diff --git a/drivers/media/platform/qcom/camss/camss-vfe-1080.c b/drivers/media/platform/qcom/camss/camss-vfe-1080.c
> new file mode 100644
> index 0000000000000..68798f13fbea8
> --- /dev/null
> +++ b/drivers/media/platform/qcom/camss/camss-vfe-1080.c
> @@ -0,0 +1,213 @@

[ ... ]

> +static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_id)
> +{
> +	int port_id = line_id;
> +
> +	camss_reg_update(vfe->camss, vfe->id, port_id, false);
> +}
> +
> +static void vfe_reg_update_clear(struct vfe_device *vfe,
> +				 enum vfe_line_id line_id)
> +{
> +	int port_id = line_id;
> +
> +	camss_reg_update(vfe->camss, vfe->id, port_id, true);
> +}
> +
> +static void vfe_addr_update(struct vfe_device *vfe, enum vfe_line_id line_id)
> +{
> +	int port_id = line_id;
> +
> +	camss_addr_update(vfe->camss, vfe->id, port_id, false);
> +}

[Severity: High]
Can vfe_reg_update() and vfe_addr_update() race with csid_isr() when
updating csid->reg_update and csid->addr_update?

When userspace queues a buffer via vfe_queue_buffer_v2() or enables an
output line via vfe_enable_output_v2(), the VFE driver holds
vfe->output_lock and calls vfe_addr_update() or vfe_reg_update(), which
forwards through camss_addr_update() and camss_reg_update() to
drivers/media/platform/qcom/camss/camss-csid-1080.c:

static void __csid_addr_update(struct csid_device *csid, int port_id)
{
	csid->addr_update |= CSID_RUP_AUP_RDI(port_id);
	writel(csid->addr_update, csid->base + CSID_AUP_CMD);

	__csid_aup_rup_trigger(csid);
}

static void __csid_reg_update(struct csid_device *csid, int port_id)
{
	csid->reg_update |= CSID_RUP_AUP_RDI(port_id);
	writel(csid->reg_update, csid->base + CSID_RUP_CMD);

	__csid_aup_rup_trigger(csid);
}

Concurrently on another CPU, csid_isr() in camss-csid-1080.c clears those
same bitmasks upon INFO_RUP_DONE without holding vfe->output_lock or any
CSID lock before calling camss_buf_done():

			if (val & INFO_RUP_DONE) {
				__csid_addr_update_clear(csid, i);
				__csid_reg_update_clear(csid, i);
			}

			if (buf_done_val & BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i))
				camss_buf_done(csid->camss, csid->id, i);

If csid_isr() runs between the bitwise OR on csid->addr_update or
csid->reg_update and the writel() to CSID_AUP_CMD or CSID_RUP_CMD (or
races with updates on another RDI port of the same CSID), could the newly
set bit be cleared or clobbered before __csid_aup_rup_trigger() is called,
causing the hardware to miss a buffer address update while
output->gen2.active_num is incremented?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261028-kaanapali-camss-v23-0-95f250b18612@oss.qualcomm.com?part=10

  parent reply	other threads:[~2026-10-28 15:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 15:20 [PATCH v23 00/15] media: qcom: camss: Add Kaanapali support Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 01/15] dt-bindings: phy: qcom,x1e80100-csi2-phy: Add Kaanapali CSI2 PHY Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 02/15] phy: qcom-mipi-csi2: Parametrise the common status register offset Hangxiang Ma
2026-10-28 15:27   ` Abel Vesa
2026-10-28 15:20 ` [PATCH v23 03/15] phy: qcom-mipi-csi2: Add Kaanapali support Hangxiang Ma
2026-10-28 15:26   ` Abel Vesa
2026-10-28 15:20 ` [PATCH v23 04/15] media: qcom: camss: Add addr_update hooks and guard CSID reg_update Hangxiang Ma
2026-10-28 15:29   ` Bryan O'Donoghue
2026-10-28 16:36   ` Loic Poulain
2026-10-28 15:20 ` [PATCH v23 05/15] media: dt-bindings: Add CAMSS device for Kaanapali Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 06/15] media: qcom: camss: Add Kaanapali compatible Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 07/15] media: qcom: camss: Add PM clock definitions for Kaanapali Hangxiang Ma
2026-10-28 15:31   ` Bryan O'Donoghue
2026-10-28 15:20 ` [PATCH v23 08/15] media: qcom: camss: csiphy: Add support for v2.4.0 two-phase CSIPHY Hangxiang Ma
2026-10-28 15:31   ` sashiko-bot
2026-10-28 15:20 ` [PATCH v23 09/15] media: qcom: camss: csid: Add support for CSID 1080 Hangxiang Ma
2026-10-28 15:36   ` sashiko-bot
2026-10-28 15:20 ` [PATCH v23 10/15] media: qcom: camss: vfe: Add support for VFE 1080 Hangxiang Ma
2026-10-28 15:33   ` Bryan O'Donoghue
2026-10-28 15:34   ` sashiko-bot [this message]
2026-10-28 15:20 ` [PATCH v23 11/15] media: qcom: camss: tpg: Add support for v2.4.0 TPG Hangxiang Ma
2026-10-28 15:29   ` sashiko-bot
2026-10-28 15:36   ` Bryan O'Donoghue
2026-10-28 15:20 ` [PATCH v23 12/15] arm64: dts: qcom: kaanapali: Add CAMSS and CSIPHY block definitions Hangxiang Ma
2026-10-28 15:28   ` Abel Vesa
2026-10-28 15:42   ` sashiko-bot
2026-10-28 15:20 ` [PATCH v23 13/15] arm64: dts: qcom: kaanapali: Add CCI controller nodes Hangxiang Ma
2026-10-28 15:28   ` Abel Vesa
2026-10-28 15:20 ` [PATCH v23 14/15] arm64: dts: qcom: kaanapali: Add camera MCLK pinctrl Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 15/15] arm64: dts: qcom: kaanapali-mtp-camera-s5kjn5: Add DT overlay Hangxiang Ma
2026-10-28 15:29   ` Abel Vesa

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-188058@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hangxiang.ma@oss.qualcomm.com \
    --cc=linux-phy@lists.infradead.org \
    --cc=media-ci@linuxtv.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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