From: sashiko-bot@kernel.org
To: "Wenmeng Liu" <wenmeng.liu@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 v7 09/23] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
Date: Sat, 14 Nov 2026 12:07:11 +0000 [thread overview]
Message-ID: <sashiko-outbox-214494@kernel.org> (raw)
In-Reply-To: <20261114-add-support-for-camss-on-sm8750-v7-9-8ff2a11835f6@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] media: qcom: camss: csid: sibling phy_rx branch clocks drop
shared RCG rate
--
commit 08b369e2e076c38176db85510f92710a98c49c6c
Author: Loic Poulain <loic.poulain@oss.qualcomm.com>
media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
This commit scales the CSID core and CSIPHY receive clocks across all
SoC generations based on the CSI-2 link frequency and votes for minimum
clock rates using clk_set_rate_range() and clk_drop_range().
> diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> index 51f20907ffde6..714cea6883a78 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid.c
[ ... ]
> @@ -532,72 +533,197 @@ const struct csid_format_info *csid_get_fmt_entry(const struct csid_format_info
> return &formats[0];
> }
>
[ ... ]
> + /*
> + * Vote for the rate as a minimum, as the clock may be shared
> + * with another CSID which needs it to run faster.
> + */
> + ret = clk_set_rate_range(clock->clk, clock->freq[j], ULONG_MAX);
> + if (ret < 0) {
> + dev_err(dev, "clk set rate range failed: %d\n", ret);
> + return ret;
> + }
> }
>
> return 0;
> }
>
> +/*
> + * Drop the minimum rates the CSID votes for and take its clocks back to their
> + * lowest level, or to the lowest level the other users of a shared clock need.
> + */
> +static void csid_release_clock_rates(struct csid_device *csid)
> +{
> + int i;
> +
> + for (i = 0; i < csid->nclocks; i++) {
> + struct camss_clock *clock = &csid->clock[i];
> + long rate;
> +
> + if (!clock->nfreqs || !csid_match_scaled_clock_name(clock))
> + continue;
> +
> + clk_drop_range(clock->clk);
> +
> + /* Round first, so that the rate respects the other votes */
> + rate = clk_round_rate(clock->clk, clock->freq[0]);
> + if (rate > 0)
> + clk_set_rate(clock->clk, rate);
> + }
> +}
[Severity: High]
Can voting on clock->clk with clk_set_rate_range() fail to protect the
shared receive RCG when two CSIDs use different child branch clocks?
On SoCs such as SM8550, SM8750, Kaanapali, SA8775P, and SM6150, full and
lite CSIDs (or individual CSID instances) acquire separate phy_rx branch
clocks (for example "csiphy_rx" / cam_cc_csid_csiphy_rx_clk and
"vfe_lite_cphy_rx" / cam_cc_ife_lite_cphy_rx_clk) that set
CLK_SET_RATE_PARENT and share the single parent RCG
cam_cc_cphy_rx_clk_src:
drivers/media/platform/qcom/camss/camss.c:csid_res_8550[] = {
...
/* CSID0 (full) */
.clock = { "csid", "csiphy_rx" },
.clock_rate = { { 400000000, 480000000 },
{ 400000000, 480000000 } },
...
/* CSID_LITE0 */
.clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
.clock_rate = { { 400000000, 480000000 },
{ 400000000, 480000000 } },
...
};
Because clk_set_rate_range() records the minimum rate on the child
branch clock's clk_core rather than on the shared parent RCG's clk_core,
rate calculations on one branch clock only inspect the rate boundaries of
that branch and its parent RCG, ignoring minimum rate votes held on
sibling branch clocks. If CSID0 is streaming at 480 MHz and CSID_LITE0
either starts a slower stream or stops and runs
csid_release_clock_rates() to set clock->freq[0] (400 MHz), the clock
framework lowers cam_cc_cphy_rx_clk_src to 400 MHz and underclocks CSID0
mid-stream.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261114-add-support-for-camss-on-sm8750-v7-0-8ff2a11835f6@oss.qualcomm.com?part=9
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Wenmeng Liu" <wenmeng.liu@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 v7 09/23] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
Date: Sat, 14 Nov 2026 12:07:11 +0000 [thread overview]
Message-ID: <sashiko-outbox-214494@kernel.org> (raw)
In-Reply-To: <20261114-add-support-for-camss-on-sm8750-v7-9-8ff2a11835f6@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] media: qcom: camss: csid: sibling phy_rx branch clocks drop
shared RCG rate
--
commit 08b369e2e076c38176db85510f92710a98c49c6c
Author: Loic Poulain <loic.poulain@oss.qualcomm.com>
media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
This commit scales the CSID core and CSIPHY receive clocks across all
SoC generations based on the CSI-2 link frequency and votes for minimum
clock rates using clk_set_rate_range() and clk_drop_range().
> diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> index 51f20907ffde6..714cea6883a78 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid.c
[ ... ]
> @@ -532,72 +533,197 @@ const struct csid_format_info *csid_get_fmt_entry(const struct csid_format_info
> return &formats[0];
> }
>
[ ... ]
> + /*
> + * Vote for the rate as a minimum, as the clock may be shared
> + * with another CSID which needs it to run faster.
> + */
> + ret = clk_set_rate_range(clock->clk, clock->freq[j], ULONG_MAX);
> + if (ret < 0) {
> + dev_err(dev, "clk set rate range failed: %d\n", ret);
> + return ret;
> + }
> }
>
> return 0;
> }
>
> +/*
> + * Drop the minimum rates the CSID votes for and take its clocks back to their
> + * lowest level, or to the lowest level the other users of a shared clock need.
> + */
> +static void csid_release_clock_rates(struct csid_device *csid)
> +{
> + int i;
> +
> + for (i = 0; i < csid->nclocks; i++) {
> + struct camss_clock *clock = &csid->clock[i];
> + long rate;
> +
> + if (!clock->nfreqs || !csid_match_scaled_clock_name(clock))
> + continue;
> +
> + clk_drop_range(clock->clk);
> +
> + /* Round first, so that the rate respects the other votes */
> + rate = clk_round_rate(clock->clk, clock->freq[0]);
> + if (rate > 0)
> + clk_set_rate(clock->clk, rate);
> + }
> +}
[Severity: High]
Can voting on clock->clk with clk_set_rate_range() fail to protect the
shared receive RCG when two CSIDs use different child branch clocks?
On SoCs such as SM8550, SM8750, Kaanapali, SA8775P, and SM6150, full and
lite CSIDs (or individual CSID instances) acquire separate phy_rx branch
clocks (for example "csiphy_rx" / cam_cc_csid_csiphy_rx_clk and
"vfe_lite_cphy_rx" / cam_cc_ife_lite_cphy_rx_clk) that set
CLK_SET_RATE_PARENT and share the single parent RCG
cam_cc_cphy_rx_clk_src:
drivers/media/platform/qcom/camss/camss.c:csid_res_8550[] = {
...
/* CSID0 (full) */
.clock = { "csid", "csiphy_rx" },
.clock_rate = { { 400000000, 480000000 },
{ 400000000, 480000000 } },
...
/* CSID_LITE0 */
.clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
.clock_rate = { { 400000000, 480000000 },
{ 400000000, 480000000 } },
...
};
Because clk_set_rate_range() records the minimum rate on the child
branch clock's clk_core rather than on the shared parent RCG's clk_core,
rate calculations on one branch clock only inspect the rate boundaries of
that branch and its parent RCG, ignoring minimum rate votes held on
sibling branch clocks. If CSID0 is streaming at 480 MHz and CSID_LITE0
either starts a slower stream or stops and runs
csid_release_clock_rates() to set clock->freq[0] (400 MHz), the clock
framework lowers cam_cc_cphy_rx_clk_src to 400 MHz and underclocks CSID0
mid-stream.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261114-add-support-for-camss-on-sm8750-v7-0-8ff2a11835f6@oss.qualcomm.com?part=9
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-11-14 12:07 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 11:29 [PATCH v7 00/23] Add CAMSS support for SM8750 and Eliza Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 01/23] dt-bindings: phy: qcom,x1e80100-csi2-phy: Add SM8750 CSI2 PHY Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 02/23] dt-bindings: phy: qcom,x1e80100-csi2-phy: Add Eliza " Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 03/23] dt-bindings: media: qcom,sm8750-camss: Add SM8750 CAMSS Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:42 ` sashiko-bot
2026-11-14 11:42 ` sashiko-bot
2026-11-14 11:29 ` [PATCH v7 04/23] dt-bindings: media: qcom,eliza-camss: Add Eliza CAMSS Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:43 ` sashiko-bot
2026-11-14 11:43 ` sashiko-bot
2026-11-14 11:29 ` [PATCH v7 05/23] dt-bindings: i2c: qcom-cci: Document Eliza compatible Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 06/23] phy: qcom-mipi-csi2: Add SM8750 support Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 07/23] media: qcom: camss: Add SM8750 compatible Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 08/23] media: qcom: camss: Add PM clock definitions for SM8750 Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 09/23] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 12:07 ` sashiko-bot [this message]
2026-11-14 12:07 ` sashiko-bot
2026-11-14 11:29 ` [PATCH v7 10/23] media: qcom: camss: csid: Add support for CSID 980 Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:55 ` sashiko-bot
2026-11-14 11:55 ` sashiko-bot
2026-11-14 11:29 ` [PATCH v7 11/23] media: qcom: camss: vfe: Add support for VFE 980 Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:42 ` sashiko-bot
2026-11-14 11:42 ` sashiko-bot
2026-11-14 11:29 ` [PATCH v7 12/23] media: qcom: camss: tpg: Add support for v2.3.0 TPG Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 13/23] media: qcom: camss: Add Eliza compatible Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 14/23] arm64: dts: qcom: sm8750: Add CAMSS and CSIPHY block definitions Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 15/23] arm64: dts: qcom: sm8750: Add CCI definitions Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 16/23] arm64: dts: qcom: sm8750: Add camera MCLK pinctrl Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 17/23] arm64: dts: qcom: sm8750-qrd: Enable S5KJN1 camera sensor Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 18/23] arm64: dts: qcom: eliza: Add CAMSS and CSIPHY block definitions Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 19/23] arm64: dts: qcom: eliza: Add CCI definitions Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 20/23] arm64: dts: qcom: eliza: Add camera MCLK pinctrl Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 21/23] arm64: dts: qcom: eliza-mtp: Add PM8010 PMICs Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 22/23] arm64: dts: qcom: eliza-mtp: Enable rear camera Wenmeng Liu
2026-11-14 11:29 ` Wenmeng Liu
2026-11-14 11:29 ` [PATCH v7 23/23] arm64: dts: qcom: eliza-evk-imx577-camera: Add DT overlay Wenmeng Liu
2026-11-14 11:29 ` 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=sashiko-outbox-214494@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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 \
--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 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.