clk: bcm2835: Correct the prediv logic
Subsystems (3)
PATCH 1/1 clk: bcm2835: Correct the prediv logic
From: Phil Elwell <[email protected]>
If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency.
---
While this is a bugfix, I haven't put a "Fixes:" line in here to get it automatically backported to stable. We had trouble with the out-of-tree DSI panel driver, at least: Our old set_rate() didn't work, because the new PLL was just barely too fast to get the integer PLL divider we needed. We may run into similar troubles elsewhere. --anholt
drivers/clk/bcm/clk-bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/bcm/clk-bcm2835.c +3 -1
@@ -616,8 +616,10 @@ static unsigned long bcm2835_pll_get_rate(struct clk_hw *hw, using_prediv =cprman_read (cprman, data->ana_reg_base +4 ) & data->ana->fb_prediv_mask; -if (using_prediv) +if (using_prediv) { ndiv *=2 ; + fdiv *=2 ; + }return bcm2835_pll_rate_from_divisors (parent_rate, ndiv, fdiv, pdiv); }
Signature · 1 line
2.11.0
Hi Eric,
Quoted 8 lines
Eric Anholt <[email protected]> hat am 15. Mai 2017 um 19:35 geschrieben:
From: Phil Elwell <[email protected]>
If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency.
Quoted 6 lines
Signed-off-by Phil Elwell <[email protected]>Signed-off-by Eric Anholt <[email protected]>---
While this is a bugfix, I haven't put a "Fixes:" line in here to get it automatically backported to stable.
sorry, i can't follow. How should this happen without "Fixes: "?
Quoted 6 lines
We had trouble with the
out-of-tree DSI panel driver, at least: Our oldset_rate()didn't work, because the new PLL was just barely too fast to get the integer PLL divider we needed. We may run into similar troubles elsewhere. --anholt
Quoted 10 lines · Stefan Wahren
Hi Eric,
Quoted 8 lines
Eric Anholt <[email protected]> hat am 15. Mai 2017 um 19:35 geschrieben:
From: Phil Elwell <[email protected]>
If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Phil Elwell <[email protected]>Signed-off-by Eric Anholt <[email protected]>---
While this is a bugfix, I haven't put a "Fixes:" line in here to get it automatically backported to stable.
sorry, i can't follow. How should this happen without "Fixes: "?
I didn't want it to be backported to stable, because of the risk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170515/803ae7fe/attachment.sig>
Stephen Boyd
AppliedQuoted 8 lines · Eric Anholt
From: Phil Elwell <[email protected]>
If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency.
Signed-off-by Phil Elwell <[email protected]>Signed-off-by Eric Anholt <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project