Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vladimir Zapolskiy" <vladimir.zapolskiy@linaro.org>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH 3/6] media: qcom: camss: tpg: Add support for v2.4.0 TPG
Date: Sat, 31 Oct 2026 11:27:56 +0000	[thread overview]
Message-ID: <sashiko-outbox-191920@kernel.org> (raw)
In-Reply-To: <20261031112203.545319-4-vladimir.zapolskiy@linaro.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] media: qcom: camss: uninitialized hw_version check in tpg_reset()
- [Low] media: qcom: camss: commit message describes omitted Kaanapali changes
--

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

media: qcom: camss: tpg: Add support for v2.4.0 TPG

This commit adds hardware support for the v2.4.0 Test Pattern Generator (TPG)
in the Qualcomm CAMSS driver by handling test-enable and hardware reset via
the TPG_CTRL_CMD register.

>     media: qcom: camss: tpg: Add support for v2.4.0 TPG
>     
>     Add support for the TPG found on Kaanapali. This TPG uses hardware
>     version 2.4.0, which drives test-enable and reset through the
>     TPG_CTRL_CMD register at offset 0x1f4 instead of the TEST_EN bit in
>     TPG_CTRL and the TPG_CLEAR register. Its output is routed into the
>     CSID 1080 RX through the CSI2 TPG mux, so the CSID selects the TPG as
>     the data source when a test pattern is selected.
>     
>     Add the TPG resources to the Kaanapali camss resources so that the TPG
>     subdevices are created on this SoC.
>     
>     Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
>     Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>     [vz: extracted pure TPG hardware support part from the change]
>     Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

[Severity: Low]
This isn't a bug, but since only the TPG v2.4.0 hardware support was extracted
into this commit, should the commit message be updated to drop the description
of the CSID 1080 RX mux routing and the Kaanapali camss resources?

> diff --git a/drivers/media/platform/qcom/camss/camss-tpg-gen1.c b/drivers/media/platform/qcom/camss/camss-tpg-gen1.c
> index d29de5f93c18e..cabbb2638cf38 100644
> --- a/drivers/media/platform/qcom/camss/camss-tpg-gen1.c
> +++ b/drivers/media/platform/qcom/camss/camss-tpg-gen1.c

[ ... ]

> @@ -164,18 +167,26 @@ static int tpg_stream_on(struct tpg_device *tpg)

[ ... ]

>  static int tpg_reset(struct tpg_device *tpg)
>  {
> -	writel(0, tpg->base + TPG_CTRL);
> -	writel(1, tpg->base + TPG_CLEAR);
> +	if (tpg->hw_version < TPG_HW_VER_2_4_0)
> +		writel(0, tpg->base + TPG_CTRL);
> +
> +	writel(TPG_CTRL_CMD_HW_RESET, tpg->base + TPG_CTRL_CMD);
>  
>  	return 0;
>  }

[Severity: Medium]
Does checking tpg->hw_version in tpg_reset() work as intended on the initial
power-on?

In drivers/media/platform/qcom/camss/camss-tpg.c, tpg_set_power() invokes
hw_ops->reset() before hw_ops->hw_version():

drivers/media/platform/qcom/camss/camss-tpg.c:tpg_set_power() {
	if (on) {
		...
		tpg->res->hw_ops->reset(tpg);

		tpg->res->hw_ops->hw_version(tpg);
	}
}

Because tpg_hw_version() in drivers/media/platform/qcom/camss/camss-tpg-gen1.c
is the only place that reads TPG_HW_VERSION and populates tpg->hw_version,
tpg->hw_version is still 0 when tpg_reset() runs during the first power-on. As
a result, tpg->hw_version < TPG_HW_VER_2_4_0 evaluates to true and writes 0 to
TPG_CTRL on v2.4.0 hardware as well.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031112203.545319-1-vladimir.zapolskiy@linaro.org?part=3

  reply	other threads:[~2026-10-31 11:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31 11:21 [PATCH 0/6] media: qcom: camss: Add SM8650 TPG support Vladimir Zapolskiy
2026-10-31 11:21 ` [PATCH 1/6] dt-bindings: media: qcom,sm8650-camss: Add test pattern generators Vladimir Zapolskiy
2026-10-31 11:34   ` sashiko-bot
2026-10-31 11:21 ` [PATCH 2/6] media: qcom: camss: Skip TPG if its registers are not described Vladimir Zapolskiy
2026-10-31 11:22 ` [PATCH 3/6] media: qcom: camss: tpg: Add support for v2.4.0 TPG Vladimir Zapolskiy
2026-10-31 11:27   ` sashiko-bot [this message]
2026-10-31 11:22 ` [PATCH 4/6] media: qcom: camss: tpg: Support TPG hardware version 2.2.0 Vladimir Zapolskiy
2026-10-31 11:28   ` sashiko-bot
2026-10-31 11:22 ` [PATCH 5/6] media: qcom: camss: Add SM8650 TPG support Vladimir Zapolskiy
2026-10-31 11:22 ` [PATCH 6/6] arm64: dts: qcom: sm8650: Add CAMSS test pattern generators Vladimir Zapolskiy

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-191920@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=vladimir.zapolskiy@linaro.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