All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Andrew Gigena" <mail@andrewgigena.dev>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH 3/4] media: qcom: camss: Add support for SM8150
Date: Wed, 04 Nov 2026 21:11:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-198051@kernel.org> (raw)
In-Reply-To: <20261104-sm8150-v7-4-rc1-camss-v1-3-7a9534a9a22f@andrewgigena.dev>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] media: qcom: camss: vfe_lite0/1 clock rates ignored in vfe_set_clock_rates()
- [Medium] media: qcom: camss: vdda-phy and vdda-pll assigned to CSID instead of CSIPHY
--

commit aa7ed9591fa067f32f7175a9e60c6b9597ae38fa
Author: Andrew Gigena <mail@andrewgigena.dev>

media: qcom: camss: Add support for SM8150

This commit adds CAMSS platform support for the Qualcomm SM8150 SoC,
including four CSIPHY, four CSID, two VFE, and two VFE-Lite instances. It
adds CAMSS_8150 to the shared CSIPHY and VFE paths and defines the per-block
clocks, regulators, power domains, interrupts, and interconnects.

> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index c54185c93a8a9..7035f5b333ff3 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -1940,6 +1940,254 @@ static const struct resources_icc icc_res_sm6350[] = {
>  	},
>  };
>  
> +static const struct camss_subdev_resources csiphy_res_sm8150[] = {
> +	/* CSIPHY0 */
> +	{
> +		.regulators = {},
> +		.clock = { "csiphy0", "csiphy0_timer" },

[ ... ]

> +static const struct camss_subdev_resources csid_res_sm8150[] = {
> +	/* CSID0 */
> +	{
> +		.regulators = {
> +			{ .supply = "vdda-phy", .init_load_uA = 0 },
> +			{ .supply = "vdda-pll", .init_load_uA = 0 }
> +		},

[Severity: Medium]
Should the vdda-phy and vdda-pll supplies be attached to csiphy_res_sm8150
instead of csid_res_sm8150 (similar to how commit 0567d0f1cc62 moved them
from CSID to CSIPHY for SM8250)?

When streaming starts via video_prepare_streaming() -> v4l2_pipeline_pm_get()
-> pipeline_pm_power(), media_graph_walk_next() pops upstream entities first,
invoking csiphy_set_power_legacy() on CSIPHY before csid_set_power() on CSID:

drivers/media/platform/qcom/camss/camss-csiphy.c:csiphy_set_power_legacy() {
	...
		ret = regulator_bulk_enable(csiphy->num_supplies,
					    csiphy->supplies);
		if (ret < 0) {
			pm_runtime_put_sync(dev);
			return ret;
		}

		ret = camss_enable_clocks(csiphy->nclocks, csiphy->clock, dev);
		if (ret < 0) {
			regulator_bulk_disable(csiphy->num_supplies,
					       csiphy->supplies);
			pm_runtime_put_sync(dev);
			return ret;
		}

		enable_irq(csiphy->irq);

		csiphy_reset(csiphy);

		csiphy->res->hw_ops->hw_version_read(csiphy, dev);
	...
}

With csiphy_res_sm8150 leaving .regulators empty and csid_res_sm8150 holding
vdda-phy and vdda-pll, won't csiphy_set_power_legacy() enable the CSIPHY
clocks and access CSIPHY registers in csiphy_reset() and hw_version_read()
before the PHY regulators are enabled, and also power on the PHY regulators
unnecessarily when CSID is used standalone with its test pattern generator?

> +		.clock = { "vfe0_csid", "vfe0_cphy_rx", "vfe0", "vfe0_axi" },

[ ... ]

> +	/* CSID_LITE0 */
> +	{
> +		.regulators = {
> +			{ .supply = "vdda-phy", .init_load_uA = 0 },
> +			{ .supply = "vdda-pll", .init_load_uA = 0 }
> +		},
> +		.clock = { "vfe_lite0_csid", "vfe_lite0_cphy_rx", "vfe_lite0" },
> +		.clock_rate = { { 400000000, 480000000, 600000000 },
> +				{ 0 },
> +				{ 0 }, },

[ ... ]

> +static const struct camss_subdev_resources vfe_res_sm8150[] = {

[ ... ]

> +	/* VFE_LITE_0 */
> +	{
> +		.regulators = {},
> +		.clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe_lite0" },
> +		.clock_rate = { { 0 },
> +				{ 0 },
> +				{ 19200000, 80000000},
> +				{ 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
> +				{ 320000000, 400000000, 480000000, 600000000 }, },
> +		.reg = { "vfe_lite0" },
> +		.interrupt = { "vfe_lite0" },
> +		.vfe = {
> +			.is_lite = true,
> +			.line_num = 4,
> +			.hw_ops = &vfe_ops_170,
> +			.formats_rdi = &vfe_formats_rdi_845,
> +			.formats_pix = &vfe_formats_pix_845
> +		}
> +	},
> +	/* VFE_LITE_1 */
> +	{
> +		.regulators = {},
> +		.clock = { "gcc_axi_hf", "gcc_axi_sf", "cpas_ahb", "camnoc_axi", "vfe_lite1" },
> +		.clock_rate = { { 0 },
> +				{ 0 },
> +				{ 19200000, 80000000},
> +				{ 19200000, 150000000, 266666667, 320000000, 400000000, 480000000 },
> +				{ 320000000, 400000000, 480000000, 600000000 }, },

[Severity: High]
Will the clock rates for vfe_lite0 and vfe_lite1 (as well as cpas_ahb) ever
get configured on SM8150?

During probe, camss_init_subdevices() initializes each entry in
vfe_res_sm8150 with vfe->id set to the array index, so VFE_LITE_0 has
vfe->id == 2 and VFE_LITE_1 has vfe->id == 3.

When powering on a VFE instance, vfe_get() calls vfe_set_clock_rates() (or
vfe_check_clock_rates()), which only processes clocks matching
vfe_match_clock_names():

drivers/media/platform/qcom/camss/camss-vfe.c:vfe_match_clock_names() {
	char vfe_name[7]; /* vfeXXX\0 */
	char vfe_lite_name[12]; /* vfe_liteXXX\0 */

	snprintf(vfe_name, sizeof(vfe_name), "vfe%d", vfe->id);
	snprintf(vfe_lite_name, sizeof(vfe_lite_name), "vfe_lite%d", vfe->id);

	return (!strcmp(clock->name, vfe_name) ||
		!strcmp(clock->name, vfe_lite_name) ||
		!strcmp(clock->name, "vfe_lite") ||
		!strcmp(clock->name, "camnoc_axi") ||
		!strcmp(clock->name, "camnoc_rt_axi"));
}

For VFE_LITE_0 and VFE_LITE_1, vfe_lite_name evaluates to "vfe_lite2" and
"vfe_lite3", which do not match "vfe_lite0" or "vfe_lite1" (nor does
vfe_match_clock_names() match "cpas_ahb"). Since csid_res_sm8150 also sets
the clock_rate entry for "vfe_lite0" and "vfe_lite1" to 0, neither
csid_set_clock_rates() nor vfe_set_clock_rates() will set their rates,
leaving the VFE-Lite clocks at their 19.2 MHz boot frequency when streaming.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-sm8150-v7-4-rc1-camss-v1-0-7a9534a9a22f@andrewgigena.dev?part=3

  reply	other threads:[~2026-11-04 21:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 20:54 [PATCH 0/4] media: qcom: camss: Add SM8150 CAMSS support Andrew Gigena via B4 Relay
2026-11-04 20:54 ` Andrew Gigena
2026-11-04 20:54 ` [PATCH 1/4] dt-bindings: i2c: qcom-cci: Document SM8150 compatible Andrew Gigena via B4 Relay
2026-11-04 20:54   ` Andrew Gigena
2026-11-04 20:59   ` sashiko-bot
2026-11-04 22:41   ` Bryan O'Donoghue
2026-11-04 23:12   ` Vladimir Zapolskiy
2026-11-04 20:54 ` [PATCH 2/4] dt-bindings: media: qcom,sm8150-camss: Add SM8150 CAMSS Andrew Gigena via B4 Relay
2026-11-04 20:54   ` Andrew Gigena
2026-11-04 21:08   ` sashiko-bot
2026-11-04 22:44   ` Bryan O'Donoghue
2026-11-06  1:29     ` Andrew Gigena
2026-11-04 23:16   ` Vladimir Zapolskiy
2026-11-05  9:47     ` Bryan O'Donoghue
2026-11-06  3:06       ` Andrew Gigena
2026-11-06 11:24         ` Bryan O'Donoghue
2026-11-06 11:30           ` Vladimir Zapolskiy
2026-11-04 20:54 ` [PATCH 3/4] media: qcom: camss: Add support for SM8150 Andrew Gigena via B4 Relay
2026-11-04 20:54   ` Andrew Gigena
2026-11-04 21:11   ` sashiko-bot [this message]
2026-11-04 21:19   ` Val Packett
2026-11-04 23:12     ` Andrew Gigena
2026-11-05  9:44   ` Bryan O'Donoghue
2026-11-06  2:41     ` Andrew Gigena
2026-11-04 20:54 ` [PATCH 4/4] arm64: dts: qcom: sm8150: Add CAMSS and CCI nodes Andrew Gigena via B4 Relay
2026-11-04 20:54   ` Andrew Gigena

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-198051@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=mail@andrewgigena.dev \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.