arm64: tegra21: emc: Make sure the DLL always has a clock
Alex Waterman [Mon, 23 May 2016 20:58:15 +0000 (13:58 -0700)]
Ensure the DLL always has a clock. If it does not then the DLL will
not be able to swap to a new clock source. That is to say the DLL
requires both the old and new clock source to be active when its
source is changed.

Bug 1655375

Change-Id: I796725b95628d7ea6753d7986af74324e9c1489b
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1152001
(cherry picked from commit e0a23c1f4a99a88b09faedd82dbdba64fc138bec)
Reviewed-on: http://git-master/r/1185062
GVS: Gerrit_Virtual_Submit
Tested-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Akhilesh Khumbum <akhumbum@nvidia.com>
Reviewed-by: Robert Collins <rcollins@nvidia.com>

drivers/platform/tegra/mc/tegra21_emc_cc_r21015.c

index 5464bb5..91c0200 100644 (file)
@@ -1646,6 +1646,13 @@ void emc_set_clock_r21015(struct tegra21_emc_table *next_timing,
                prelock_dll_en = 1;
        } else {
                emc_cc_dbg(INFO, "Disabling DLL for target frequency.\n");
+
+               /*
+                * Ensure that even if the DLL is disabled for the given
+                * frequency it still has an active clock source. If it does
+                * not then it will not work during the next clock change.
+                */
+               change_dll_src(next_timing, clksrc);
                dll_disable(channel_mode);
        }