linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: tegra: fix overflow in tegra20_pll_clk_round_rate()
@ 2012-09-10 23:12 Stephen Warren
  2012-09-10 23:12 ` [PATCH 2/2] ARM: tegra: cpu-tegra: explicitly manage re-parenting Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Stephen Warren @ 2012-09-10 23:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

32-bit math isn't enough when e.g. *prate=12000000, and sel->n=1000.
Use 64-bit math to prevent this.

Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Prashant, can you please audit all of the Tegra clock driver to see if
there are any other instances of the same issue? Thanks.
---
 arch/arm/mach-tegra/tegra20_clocks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-tegra/tegra20_clocks.c b/arch/arm/mach-tegra/tegra20_clocks.c
index ee6922b..e2a43e4 100644
--- a/arch/arm/mach-tegra/tegra20_clocks.c
+++ b/arch/arm/mach-tegra/tegra20_clocks.c
@@ -798,7 +798,7 @@ static long tegra20_pll_clk_round_rate(struct clk_hw *hw, unsigned long rate,
 	struct clk_tegra *c = to_clk_tegra(hw);
 	const struct clk_pll_freq_table *sel;
 	unsigned long input_rate = *prate;
-	unsigned long output_rate = *prate;
+	u64 output_rate = *prate;
 	int mul;
 	int div;
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-09-12  4:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10 23:12 [PATCH 1/2] ARM: tegra: fix overflow in tegra20_pll_clk_round_rate() Stephen Warren
2012-09-10 23:12 ` [PATCH 2/2] ARM: tegra: cpu-tegra: explicitly manage re-parenting Stephen Warren
2012-09-11  4:45   ` Mike Turquette
2012-09-11  5:43     ` Stephen Warren
     [not found]       ` <504F22E6.9040307@nvidia.com>
2012-09-11 17:20         ` Mike Turquette
2012-09-12  4:10     ` Shawn Guo
2012-09-12  3:57       ` Turquette, Mike
2012-09-11  6:19 ` [PATCH 1/2] ARM: tegra: fix overflow in tegra20_pll_clk_round_rate() Prashant Gaikwad
2012-09-11 16:38 ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).