Re: [PATCH] clk: tegra: Fix Tegra210 IQC2 clock lookup
From: Mikko Perttunen
Date: Thu Nov 26 2026 - 02:58:37 EST
On Saturday, October 24, 2026 8:01 PM Karl Mehltretter wrote:
> gate_clks[] uses tegra_clk_iqc1 for both iqc1 and iqc2. On Tegra210,
> gate_clk_init() overwrites the TEGRA210_CLK_IQC1 provider entry with
> iqc2 and leaves TEGRA210_CLK_IQC2 unpopulated, so looking up
> TEGRA210_CLK_IQC2 fails with -EINVAL.
>
> Use tegra_clk_iqc2 for the iqc2 gate.
>
> Fixes: 88da44c5edb9 ("clk: tegra: Add missing Tegra210 clocks")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
> ---
> Tested on a Jetson Nano 4GB (Tegra210) with a small probe module that
> calls of_clk_get_from_provider() on the Tegra210 CAR node. Unpatched,
> TEGRA210_CLK_IQC2 (220) returns -EINVAL and TEGRA210_CLK_IQC1 (221)
> resolves to iqc2. With this patch on 5b0764a53235, ID 220 resolves to
> iqc2 and ID 221 resolves to iqc1.
>
> drivers/clk/tegra/clk-tegra-periph.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/tegra/clk-tegra-periph.c b/drivers/clk/tegra/clk-tegra-periph.c
> index 4dcf7f7..47bb657 100644
> --- a/drivers/clk/tegra/clk-tegra-periph.c
> +++ b/drivers/clk/tegra/clk-tegra-periph.c
> @@ -813,7 +813,7 @@ static struct tegra_periph_init_data gate_clks[] = {
> GATE("apb2ape", "clk_m", 107, 0, tegra_clk_apb2ape, 0),
> GATE("cec", "pclk", 136, 0, tegra_clk_cec, 0),
> GATE("iqc1", "clk_m", 221, 0, tegra_clk_iqc1, 0),
> - GATE("iqc2", "clk_m", 220, 0, tegra_clk_iqc1, 0),
> + GATE("iqc2", "clk_m", 220, 0, tegra_clk_iqc2, 0),
> GATE("pll_a_out_adsp", "pll_a", 188, 0, tegra_clk_pll_a_out_adsp, 0),
> GATE("pll_a_out0_out_adsp", "pll_a", 188, 0, tegra_clk_pll_a_out0_out_adsp, 0),
> GATE("adsp", "aclk", 199, 0, tegra_clk_adsp, 0),
>
> base-commit: 5b0764a53235d3c77e1ed674e836e1b3fe1a4b1f
> --
> 2.39.5 (Apple Git-154)
>
>
Reviewed-by: Mikko Perttunen <mperttunen@xxxxxxxxxx>