Files
linux/drivers/clk
Uwe Kleine-König aaa2bf750a clk: divider: fix calculation of maximal parent rate for a given divider
[ Upstream commit da321133b5 ]

The rate provided at the output of a clk-divider is calculated as:

	DIV_ROUND_UP(parent_rate, div)

since commit b11d282dbe (clk: divider: fix rate calculation for
fractional rates). So to yield a rate not bigger than r parent_rate
must be <= r * div.

The effect of choosing a parent rate that is too big as was done before
this patch results in wrongly ruling out good dividers.

Note that this is not a complete fix as __clk_round_rate might return a
value >= its 2nd parameter. Also for dividers with
CLK_DIVIDER_ROUND_CLOSEST set the calculation is not accurate. But this
fixes the test case by Sascha Hauer that uses a chain of three dividers
under a fixed clock.

Fixes: b11d282dbe (clk: divider: fix rate calculation for fractional rates)
Suggested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-04-24 17:14:11 -04:00
..
2014-09-28 10:27:09 +08:00
2014-11-17 11:25:29 -08:00
2014-07-28 23:30:46 -07:00
2012-08-31 11:05:18 -07:00
2013-05-31 12:07:45 -07:00
2014-05-27 18:29:04 -07:00
2014-05-22 15:54:59 -07:00