diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-02-06 20:09:15 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-02-26 17:16:28 -0500 |
commit | e186ad74c0941f5caeda28bde76dab903b342c1c (patch) | |
tree | e92b60b51487b53399d89552a2ec514a9d5b021c /arch/arm/mach-tegra/tegra2_clocks.c | |
parent | 64092d8f34774429a2519622e5cf0ca63b1ba517 (diff) |
ARM: tegra: Demote EMC clock inconsistency BUG to WARN
When this inconsistency occurs, the system will typically operate without
issue, it's just that EMC scaling won't optimally. Convert the BUG_ON to
a WARN_ONCE in order to allow the kernel to boot, but still complain.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra/tegra2_clocks.c')
-rw-r--r-- | arch/arm/mach-tegra/tegra2_clocks.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c index ff9e6b6c0460..1976e934cdd9 100644 --- a/arch/arm/mach-tegra/tegra2_clocks.c +++ b/arch/arm/mach-tegra/tegra2_clocks.c | |||
@@ -1143,15 +1143,35 @@ static void tegra2_emc_clk_init(struct clk *c) | |||
1143 | 1143 | ||
1144 | static long tegra2_emc_clk_round_rate(struct clk *c, unsigned long rate) | 1144 | static long tegra2_emc_clk_round_rate(struct clk *c, unsigned long rate) |
1145 | { | 1145 | { |
1146 | long new_rate = rate; | 1146 | long emc_rate; |
1147 | long clk_rate; | ||
1147 | 1148 | ||
1148 | new_rate = tegra_emc_round_rate(new_rate); | 1149 | /* |
1149 | if (new_rate < 0) | 1150 | * The slowest entry in the EMC clock table that is at least as |
1151 | * fast as rate. | ||
1152 | */ | ||
1153 | emc_rate = tegra_emc_round_rate(rate); | ||
1154 | if (emc_rate < 0) | ||
1150 | return c->max_rate; | 1155 | return c->max_rate; |
1151 | 1156 | ||
1152 | BUG_ON(new_rate != tegra2_periph_clk_round_rate(c, new_rate)); | 1157 | /* |
1158 | * The fastest rate the PLL will generate that is at most the | ||
1159 | * requested rate. | ||
1160 | */ | ||
1161 | clk_rate = tegra2_periph_clk_round_rate(c, emc_rate); | ||
1162 | |||
1163 | /* | ||
1164 | * If this fails, and emc_rate > clk_rate, it's because the maximum | ||
1165 | * rate in the EMC tables is larger than the maximum rate of the EMC | ||
1166 | * clock. The EMC clock's max rate is the rate it was running when the | ||
1167 | * kernel booted. Such a mismatch is probably due to using the wrong | ||
1168 | * BCT, i.e. using a Tegra20 BCT with an EMC table written for Tegra25. | ||
1169 | */ | ||
1170 | WARN_ONCE(emc_rate != clk_rate, | ||
1171 | "emc_rate %ld != clk_rate %ld", | ||
1172 | emc_rate, clk_rate); | ||
1153 | 1173 | ||
1154 | return new_rate; | 1174 | return emc_rate; |
1155 | } | 1175 | } |
1156 | 1176 | ||
1157 | static int tegra2_emc_clk_set_rate(struct clk *c, unsigned long rate) | 1177 | static int tegra2_emc_clk_set_rate(struct clk *c, unsigned long rate) |