Re: [PATCH] clk: tegra: tegra124-emc: Skip timings whose parent rate cannot be set

From: Brian Masney

Date: Tue Nov 24 2026 - 12:18:44 EST


Hi Jon / Thierry / Mikko,

> Each EMC timing names a parent clock and the rate that parent has to run
> at. On Tegra114, PLLM is registered with TEGRA_PLL_FIXED, so its rate
> cannot be changed, but the Tegra114 device trees still contain timings
> on pll_m at rates the bootloader did not set up, e.g. 792 MHz on a
> Tegra Note 7 where the bootloader leaves PLLM at 408 MHz.
>
> emc_set_timing() calls clk_set_rate() on the parent, which succeeds
> without changing anything, and then loads the 792 MHz timing while the
> EMC runs at 408 MHz. On the Tegra Note 7 that gives a refresh interval
> of about 15 us instead of 7.7 us (DDR3 allows 7.8 us), and the clock
> core then reports 408 MHz, so later requests for 408 MHz keep the
> 792 MHz register values.
>
> Skip timings whose parent cannot be rounded to the requested rate when
> loading them, so that the highest reachable timing is used instead.
> On Tegra124 PLLM is not fixed, so its timings should all stay; this was
> not tested on Tegra124.
>
> Fixes: cf561283254d ("clk: tegra: set up proper EMC clock implementation for Tegra114")
> Cc: stable+noautosel@xxxxxxxxxx # needs the Tegra114 EMC auto-calibration fixes
> Signed-off-by: Patrick Fischer <admin@xxxxxxxxxxxxxxxxxx>

I'd like to see someone from Nvidia review this before I take it.

Brian

--
Brian Masney <masneyb@xxxxxxxxxx>