Skip to contentSkip to conversation

clk: tegra: Fix Tegra210 IQC2 clock lookup

PATCH In review Karl Mehltretter 2 participants 2 messages Oct 24 – Nov 26

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: tegra: Fix Tegra210 IQC2 clock lookup

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

---
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(-)
drivers/clk/tegra/clk-tegra-periph.c +1 -1
index 4dcf7f7..47bb657 100644
@@ -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

Signature · 1 line
2.39.5 (Apple Git-154)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines · Karl Mehltretter

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

---
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(-)
drivers/clk/tegra/clk-tegra-periph.c +1 -1
index 4dcf7f7..47bb657 100644
@@ -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),
Quoted 5 lines

base-commit: 5b0764a53235d3c77e1ed674e836e1b3fe1a4b1f

Signature · 1 line
2.39.5 (Apple Git-154)