From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796207380; b=xSAdagCttuJKyQIDXXHoop05F2LcalSMlCU+L70bt+jf8wLkvPNJP+J3e6qUgOq2YcY+ f/pXQ2+LdPthLuxn6ar2xNsOL2/qR6mytt6s+UgAA/uaXriec5X+DjDtR/8zo066VzygF 4bU2ZeQIuNN0SCttG6chM6KMyDN2zj7NaRBz/UjV5hdcBsjM8guTnrBNwnTT/sqve8OyD ix/DW0Uf4LiCFOUDvxmuMBxqMn2r/eiRS0hRxbZ0i4pUTtHuQHw4vNd4rWHwzkRXkHsPP 9GGmGemx2/XBO7h+nBb7Hyat/k9e9kLjCYyuLV17B6amgpbgakj23Xpa1O3KR8WAsyw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796207380; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Dkt/OvweUwm5uCjS9OIDzmVAzwDkltWAYFeTa/PNWkQ=; b=D9C1PH9PvIGfxQkKLRUPnrmOgvOu2FqpGEFVUkYjJSGwPePr5GIXAFKbAfSo+xOw/Pve w26nDR4QK2hC9/h7N6pnTPiQlbZlHMJo8dfbwBzTPzT+iKLjEWd+u6lL9yB7Q7rgZY1lD AWI6SzchhIiCEZuThn/daLqEEqb3SrGo2Yw6uWKAnD7iTTQj9cDvgnf1ptxqYiviAMmZ0 yZhArpvXJKZ/EMrgTSERFYZvH9xKNLl8ydJ0eUMFulAFkz0Hm9FrWr5ghoAoSxtqfy6nr t7XF78gtG3PqoaBHGQO/4rqYVl0oY5ik+uHWPMgkmekliLm47ZUTXV/vN+MY5bx1big== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bAKQDbUk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E318606A323 for ; Wed, 2 Dec 2026 10:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bAKQDbUk Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C6F01F00896; Wed, 2 Dec 2026 10:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796207379; bh=Dkt/OvweUwm5uCjS9OIDzmVAzwDkltWAYFeTa/PNWkQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=bAKQDbUk8U0wRzp9+TpGnva51IzjEeoXtjzUB+dc7JXQLHVsFw0BgRqTcWMCcGvPL PN+XRTKUeifDxGTJrIMvZQVMYAC9q1jaVSwq8Ew4hZlqlGM3Jmp2nWlcqgiobalgU9 AztmhSTZba8XAMKNigz9BgpN18las1aOyqGUbnM5YHJWHp6uicRz91Ic9B23HrkUzc BOsK5CoVMx4MW8e3+VGuH1ua0BrOQ8uEtzfcozYMJj4+dAkdMFDT2l/t7ZBo+q17dw s1og2EmGGJ96VHrJzsWr8ilgCaUdN+3uj/ORqXbS1DPYmY8wo1HYn/4eD2XxabvxL4 ArANU6tp2Kalg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v8 08/23] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate Reply-To: sashiko-reviews@lists.linux.dev To: "Wenmeng Liu" 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 In-Reply-To: <20261202-add-support-for-camss-on-sm8750-v8-8-a07210023c55@oss.qualcomm.com> References: <20261202-add-support-for-camss-on-sm8750-v8-0-a07210023c55@oss.qualcomm.com> <20261202-add-support-for-camss-on-sm8750-v8-8-a07210023c55@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 10:29:38 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 cfe5f923a80f621718373259e5481e6e4f75cb38 Author: Loic Poulain media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate This commit calculates the minimum CSID core and CSIPHY receive clock rates from the CSI-2 link frequency across all CSID generations and votes for them with clk_set_rate_range(). > diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/med= ia/platform/qcom/camss/camss-csid.c > index e8ecac3505b77..15bde95bea078 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 [ ... ] > + /* > + * Vote for the rate as a minimum, as the clock may be shared > + * with another CSID which needs it to run faster. > + */ > + ret =3D 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; > + } > } > =20 > return 0; > } > =20 > +/* > + * 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 cloc= k need. > + */ > +static void csid_release_clock_rates(struct csid_device *csid) > +{ > + int i; > + > + for (i =3D 0; i < csid->nclocks; i++) { > + struct camss_clock *clock =3D &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 =3D clk_round_rate(clock->clk, clock->freq[0]); > + if (rate > 0) > + clk_set_rate(clock->clk, rate); > + } > +} [Severity: High] Can voting on a child phy_rx branch clock allow a sibling branch clock to drop the shared parent RCG below an active CSID's minimum rate? On SoCs such as SM8550, SM8750, Eliza and Kaanapali, full CSIDs use csiphy_rx (CAM_CC_CSID_CSIPHY_RX_CLK) while lite CSIDs use vfe_lite_cphy_rx (CAM_CC_IFE_LITE_CPHY_RX_CLK), and on SM6150 each CSID uses its own vfe0_cphy_rx, vfe1_cphy_rx or vfe_lite_cphy_rx clock: drivers/media/platform/qcom/camss/camss.c: /* CSID 0 */ { ... .clock =3D { "csid", "csiphy_rx" }, .clock_rate =3D { { 400000000, 480000000 }, { 400000000, 480000000 } }, ... /* CSID 3 (lite) */ { ... .clock =3D { "vfe_lite_csid", "vfe_lite_cphy_rx" }, .clock_rate =3D { { 400000000, 480000000 }, { 400000000, 480000000 } }, In the camcc clock drivers, these are distinct clk_branch2 leaf clocks with CLK_SET_RATE_PARENT parented to a single shared RCG (cam_cc_cphy_rx_clk_src). clk_set_rate_range() records the minimum rate constraint on the child branch clock's clk_core, not on the parent RCG. When another CSID using a sibling branch clock starts a slower stream in csid_set_clock_rates() or stops streaming in csid_release_clock_rates() and lowers its branch clock to clock->freq[0], the CCF rate calculation only checks the bounds on that sibling branch clk_core and the parent RCG clk_core. Because neither holds the active CSID's minimum vote, clk_change_rate() reprograms cam_cc_cphy_rx_clk_src to the lower frequency and underclocks the active CSID's receive interface mid-stream. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-add-suppor= t-for-camss-on-sm8750-v8-0-a07210023c55@oss.qualcomm.com?part=3D8