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

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] media: qcom: camss: Data race on aup_update and rup_update masks
--

commit d62dff88807e9c3cde57315a677507f8c380eeee
Author: Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>

media: qcom: camss: csid: Add support for CSID 900

Add a CSID driver for the "900" revision on the Nord SoC. It shares the
CSI-2 RX helpers and the split RUP/AUP command model of the gen3/980
lineage, but uses a single register map for both the full and lite
instances, so add a separate file rather than a variant of an existing
CSID.

> diff --git a/drivers/media/platform/qcom/camss/camss-csid-900.c b/drivers/media/platform/qcom/camss/camss-csid-900.c
> new file mode 100644
> index 0000000000000..921ddb7aca37f
> --- /dev/null
> +++ b/drivers/media/platform/qcom/camss/camss-csid-900.c
[ ... ]
> +static void __csid_aup_update(struct csid_device *csid, int port_id)
> +{
> +	csid->aup_update |= CSID_RUP_AUP_RDI(port_id);
> +	writel(csid->aup_update, csid->base + CSID_AUP_CMD);
> +
> +	__csid_aup_rup_trigger(csid);
> +}
> +
> +static void __csid_rup_update(struct csid_device *csid, int port_id)
> +{
> +	csid->rup_update |= CSID_RUP_AUP_RDI(port_id);
> +	writel(csid->rup_update, csid->base + CSID_RUP_CMD);
> +
> +	__csid_aup_rup_trigger(csid);
> +}

[Severity: High]
Is there a potential data race on the aup_update and rup_update masks here?

These variables are modified using non-atomic read-modify-write operations
in process context during stream start and buffer queueing, without holding
a lock or disabling interrupts.

> +
> +static void __csid_aup_rup_clear(struct csid_device *csid, int port_id)
> +{
> +	/* Hardware clears the registers upon consuming the settings */
> +	csid->aup_update &= ~CSID_RUP_AUP_RDI(port_id);
> +	csid->rup_update &= ~CSID_RUP_AUP_RDI(port_id);
> +}

[Severity: High]
Can these modifications concurrently race against the updates in
__csid_aup_update() and __csid_rup_update()?

__csid_aup_rup_clear() is called from hardirq context via csid_isr() when
clearing the INFO_RUP_DONE bit, which also does not appear to hold a lock.

If process context (such as a userspace ioctl queuing new buffers) races
against the hardware interrupt continuously generating buffer-done interrupts
during streaming, could the driver state become corrupted? This might lead to
lost or spurious hardware register updates, which could hang the V4L2
streaming pipeline or cause dropped buffers.

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

  reply	other threads:[~2026-09-15  9:50 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 [this message]
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
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=20260915095028.BB2DC1F000FF@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