From: sashiko-bot@kernel.org
To: "Sreeshankar K" <sreeshankar0910@gmail.com>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v18 2/8] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Date: Sun, 06 Dec 2026 05:39:46 +0000 [thread overview]
Message-ID: <sashiko-outbox-252186@kernel.org> (raw)
In-Reply-To: <20261206-sm7250-v18-2-954befb935bb@gmail.com>
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] clk: qcom: gcc-sm7250: wrong ops on
gcc_ufs_phy_unipro_core_clk_src
- [Low] clk: qcom: gcc-sm7250: open-coded subsys_initcall boilerplate
- [Low] clk: qcom: gcc-sm7250: gcc_cpuss_ahb_clk_src omits GPLL0 parents
- [Low] clk: qcom: gcc-sm7250: omit 0xf050 mock_utmi post-divider
--
commit a292a885f0973b1b98e878a0415d7b0876f4775c
Author: Sreeshankar K <sreeshankar0910@gmail.com>
clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
This commit adds the Global Clock Controller (GCC) driver for the
Qualcomm SM7250 SoC, registering its PLLs, RCGs, branch clocks, GDSCs,
and resets.
> diff --git a/drivers/clk/qcom/gcc-sm7250.c b/drivers/clk/qcom/gcc-sm7250.c
> new file mode 100644
> index 0000000000000..a2c65546ac2da
> --- /dev/null
> +++ b/drivers/clk/qcom/gcc-sm7250.c
> @@ -0,0 +1,2277 @@
[ ... ]
> +static const struct parent_map gcc_parent_map_0_ao[] = {
> + { P_BI_TCXO, 0 },
> +};
> +
> +static const struct clk_parent_data gcc_parent_data_0_ao[] = {
> + { .index = DT_BI_TCXO_AO },
> +};
[ ... ]
> +static struct clk_rcg2 gcc_cpuss_ahb_clk_src = {
> + .cmd_rcgr = 0x48010,
> + .mnd_width = 0,
> + .hid_width = 5,
> + .parent_map = gcc_parent_map_0_ao,
> + .freq_tbl = ftbl_gcc_cpuss_ahb_clk_src,
> + .clkr.hw.init = &(const struct clk_init_data){
> + .name = "gcc_cpuss_ahb_clk_src",
> + .parent_data = gcc_parent_data_0_ao,
> + .num_parents = ARRAY_SIZE(gcc_parent_data_0_ao),
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_rcg2_ops,
> + },
> +};
[Severity: Low]
Should gcc_cpuss_ahb_clk_src reuse gcc_parent_map_0 and include gpll0 and
gpll0_out_even in gcc_parent_data_0_ao?
Because num_parents is 1, __clk_init_parent() skips clk_rcg2_get_parent()
and unconditionally binds the clock to bi_tcxo_ao. If firmware leaves
CPUSS AHB running from GPLL0, clk_rcg2_recalc_rate() will divide 19.2 MHz
by the hardware divider and report the wrong rate. Sibling GCC drivers
such as gcc-sm8250.c reuse gcc_parent_map_0 and list both GPLL0 parents
in gcc_parent_data_0_ao, which also avoids duplicating gcc_parent_map_2.
[ ... ]
> +static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = {
> + .cmd_rcgr = 0x77084,
> + .mnd_width = 0,
> + .hid_width = 5,
> + .parent_map = gcc_parent_map_0,
> + .freq_tbl = ftbl_gcc_ufs_phy_unipro_core_clk_src,
> + .clkr.hw.init = &(const struct clk_init_data){
> + .name = "gcc_ufs_phy_unipro_core_clk_src",
> + .parent_data = gcc_parent_data_0,
> + .num_parents = ARRAY_SIZE(gcc_parent_data_0),
> + .ops = &clk_rcg2_ops,
> + },
> +};
[Severity: Medium]
Should gcc_ufs_phy_unipro_core_clk_src use clk_rcg2_shared_ops like the
other UFS PHY RCGs under ufs_phy_gdsc?
With clk_rcg2_ops, this GPLL0-sourced RCG is not parked on the safe XO
source at registration or disable, which can leave it stuck and wedge
ufs_phy_gdsc on power-domain transitions. In addition, ufshcd_init_clocks()
calls clk_set_rate() before enabling UFS clocks, which can fail with
-EBUSY when clk_rcg2_ops tries to update the unparked RCG directly.
[ ... ]
> +static struct clk_branch gcc_usb30_prim_mock_utmi_clk = {
> + .halt_reg = 0xf01c,
> + .halt_check = BRANCH_HALT,
> + .clkr = {
> + .enable_reg = 0xf01c,
> + .enable_mask = BIT(0),
> + .hw.init = &(const struct clk_init_data){
> + .name = "gcc_usb30_prim_mock_utmi_clk",
> + .parent_hws = (const struct clk_hw*[]) {
> + &gcc_usb30_prim_mock_utmi_clk_src.clkr.hw,
> + },
> + .num_parents = 1,
> + .flags = CLK_SET_RATE_PARENT,
> + .ops = &clk_branch2_ops,
> + },
> + },
> +};
[Severity: Low]
Is gcc_usb30_prim_mock_utmi_clk missing the read-only post-divider at
offset 0xf050 between gcc_usb30_prim_mock_utmi_clk_src and this branch?
Other GCC drivers sharing this 0xf000..0xf080 USB30_PRIM register layout
(such as gcc-sm8250.c and gcc-sc7280.c) model a clk_regmap_div at 0xf050
with clk_regmap_div_ro_ops as the parent of gcc_usb30_prim_mock_utmi_clk.
If hardware or firmware sets a non-unity divider there, omitting it causes
this clock to misreport its rate and ignore the divider during rate
propagation.
[ ... ]
> +static int __init gcc_sm7250_init(void)
> +{
> + return platform_driver_register(&gcc_sm7250_driver);
> +}
> +subsys_initcall(gcc_sm7250_init);
> +
> +static void __exit gcc_sm7250_exit(void)
> +{
> + platform_driver_unregister(&gcc_sm7250_driver);
> +}
> +module_exit(gcc_sm7250_exit);
[Severity: Low]
This isn't a bug, but the init/exit boilerplate can be replaced with
subsys_platform_driver(gcc_sm7250_driver), matching the rest of the
Qualcomm clock drivers after commit 256a98c69673 ("clk: qcom: convert
drivers over to use subsys_platform_driver()").
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261206-sm7250-v18-0-954befb935bb@gmail.com?part=2
next prev parent reply other threads:[~2026-12-06 5:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 5:15 [PATCH v18 0/8] Add initial support for Qualcomm SM7250 SoC Sreeshankar K
2026-12-06 5:15 ` [PATCH v18 1/8] dt-bindings: clock: Add SM7250 global clock controller Sreeshankar K
2026-12-06 5:15 ` [PATCH v18 2/8] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250 Sreeshankar K
2026-12-06 5:39 ` sashiko-bot [this message]
2026-12-06 5:15 ` [PATCH v18 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings Sreeshankar K
2026-12-06 5:15 ` [PATCH v18 4/8] dt-bindings: thermal: lmh: Document SM7250 LMh Sreeshankar K
2026-12-06 5:15 ` [PATCH v18 5/8] thermal/qcom/lmh: Add support for Qualcomm SM7250 Sreeshankar K
2026-12-06 5:15 ` [PATCH v18 6/8] dt-bindings: firmware: qcom,scm: Document SM7250 SCM Sreeshankar K
2026-12-06 5:15 ` [PATCH v18 7/8] dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware Sreeshankar K
2026-12-06 5:15 ` [PATCH v18 8/8] arm64: dts: qcom: Add SM7250 devicetree file Sreeshankar K
2026-12-06 5:33 ` sashiko-bot
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-252186@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sreeshankar0910@gmail.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