Re: [PATCH v2 11/15] clk: qcom: Add Global Clock Controller driver for Kuno

[email protected]
Newsgroups org.kernel.vger.linux-clk,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The `gcc_sdcc4_apps_clk_src` clock is configured with `clk_rcg2_ops` instead of `clk_rcg2_floor_ops`, causing frequencies to be rounded to the closest value rather than strictly rounded down.
--

--- Patch [11]: [PATCH v2 11/15] clk: qcom: Add Global Clock Controller driver for Kuno ---
commit ade5c3550fedfcea560b82feb4f95ed6684c4853
Author: Hardeep Sharma <[email protected]>

clk: qcom: Add Global Clock Controller driver for Kuno

This commit adds the global clock controller (GCC) driver for the Qualcomm
Kuno SoC. It provides the PLLs, root clock generators, gate/branch clocks,
and resets used by peripheral devices such as UART, SPI, I2C, USB, SD, PCIe,
and Ethernet.

> diff --git a/drivers/clk/qcom/gcc-kuno.c b/drivers/clk/qcom/gcc-kuno.c
> new file mode 100644
> index 0000000000000..f7401ae315dd0
> --- /dev/null
> +++ b/drivers/clk/qcom/gcc-kuno.c

[ ... ]

> +static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
> +	.cmd_rcgr = 0x6a01c,
> +	.mnd_width = 8,
> +	.hid_width = 5,
> +	.parent_map = gcc_parent_map_0,
> +	.freq_tbl = ftbl_gcc_sdcc4_apps_clk_src,
> +	.clkr.hw.init = &(const struct clk_init_data) {
> +		.name = "gcc_sdcc4_apps_clk_src",
> +		.parent_data = gcc_parent_data_0,
> +		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
> +		.ops = &clk_rcg2_ops,

[Severity: High]
Does this clock source need to use clk_rcg2_floor_ops instead of clk_rcg2_ops?

When the MMC driver requests a maximum safe operating frequency based on the
SD card specification, using standard clk_rcg2_ops can round the frequency up
to the closest available table entry rather than strictly rounding down. This
could exceed maximum frequency limits and potentially lead to data corruption
or hardware issues.

> +	},
> +};

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=11
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.