]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
memory: tegra: Remove periodic compensation duplicate calls
authorDiogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Thu, 4 Jul 2024 11:31:20 +0000 (12:31 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 29 Jul 2024 15:35:19 +0000 (17:35 +0200)
Prior to calling periodic_compensation_handler() the code is doing one
extra DRAM delay reading which is unnecessary as this is already done
in periodic_compensation_handler(), so remove these extra calls.

Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Link: https://lore.kernel.org/r/20240704-tegra210_emcfreq-v4-1-3e450503c555@tecnico.ulisboa.pt
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/memory/tegra/tegra210-emc-cc-r21021.c

index 4cb608c71ead5208cc7da9481cdb30bac2dc4622..9ec49ced8f91a0a73bd98d07bffa5ad29d292860 100644 (file)
@@ -492,7 +492,6 @@ static u32 tegra210_emc_r21021_periodic_compensation(struct tegra210_emc *emc)
        };
        struct tegra210_emc_timing *last = emc->last;
        unsigned int items = ARRAY_SIZE(list), i;
-       unsigned long delay;
 
        if (last->periodic_training) {
                emc_dbg(emc, PER_TRAIN, "Periodic training starting\n");
@@ -530,18 +529,9 @@ static u32 tegra210_emc_r21021_periodic_compensation(struct tegra210_emc *emc)
                /*
                 * 2. osc kick off - this assumes training and dvfs have set
                 *    correct MR23.
-                */
-               tegra210_emc_start_periodic_compensation(emc);
-
-               /*
+                *
                 * 3. Let dram capture its clock tree delays.
-                */
-               delay = tegra210_emc_actual_osc_clocks(last->run_clocks);
-               delay *= 1000;
-               delay /= last->rate + 1;
-               udelay(delay);
-
-               /*
+                *
                 * 4. Check delta wrt previous values (save value if margin
                 *    exceeds what is set in table).
                 */
@@ -734,11 +724,6 @@ static void tegra210_emc_r21021_set_clock(struct tegra210_emc *emc, u32 clksrc)
                                                     EMC_EMC_STATUS_DRAM_IN_SELF_REFRESH_MASK,
                                                     0);
 
-               tegra210_emc_start_periodic_compensation(emc);
-
-               delay = 1000 * tegra210_emc_actual_osc_clocks(last->run_clocks);
-               udelay((delay / last->rate) + 2);
-
                value = periodic_compensation_handler(emc, DVFS_SEQUENCE, fake,
                                                      next);
                value = (value * 128 * next->rate / 1000) / 1000000;