All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: bcm2835: Correct the prediv logic
@ 2017-05-15 17:35 ` Eric Anholt
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2017-05-15 17:35 UTC (permalink / raw)
  To: Lee Jones, Florian Fainelli, Michael Turquette, Stephen Boyd
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-kernel, Stefan Wahren,
	bcm-kernel-feedback-list, linux-clk, Phil Elwell, Eric Anholt

From: Phil Elwell <phil@raspberrypi.org>

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 <phil@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
---

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(-)

diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index 025853870619..7a35df6b45bd 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -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);
 }
-- 
2.11.0

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

* [PATCH] clk: bcm2835: Correct the prediv logic
@ 2017-05-15 17:35 ` Eric Anholt
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2017-05-15 17:35 UTC (permalink / raw)
  To: linux-arm-kernel

From: Phil Elwell <phil@raspberrypi.org>

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 <phil@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
---

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(-)

diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index 025853870619..7a35df6b45bd 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -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);
 }
-- 
2.11.0

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

* Re: [PATCH] clk: bcm2835: Correct the prediv logic
  2017-05-15 17:35 ` Eric Anholt
@ 2017-05-15 17:47   ` Stefan Wahren
  -1 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-05-15 17:47 UTC (permalink / raw)
  To: Lee Jones, Eric Anholt, Michael Turquette, Stephen Boyd,
	Florian Fainelli
  Cc: Phil Elwell, linux-clk, linux-kernel, bcm-kernel-feedback-list,
	linux-rpi-kernel, linux-arm-kernel

Hi Eric,

> Eric Anholt <eric@anholt.net> hat am 15. Mai 2017 um 19:35 geschrieben:
> 
> 
> From: Phil Elwell <phil@raspberrypi.org>
> 
> 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 <phil@raspberrypi.org>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---
> 
> 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: "?

> 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
>

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

* [PATCH] clk: bcm2835: Correct the prediv logic
@ 2017-05-15 17:47   ` Stefan Wahren
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-05-15 17:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eric,

> Eric Anholt <eric@anholt.net> hat am 15. Mai 2017 um 19:35 geschrieben:
> 
> 
> From: Phil Elwell <phil@raspberrypi.org>
> 
> 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 <phil@raspberrypi.org>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---
> 
> 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: "?

> 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
>

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

* Re: [PATCH] clk: bcm2835: Correct the prediv logic
  2017-05-15 17:47   ` Stefan Wahren
@ 2017-05-15 19:03     ` Eric Anholt
  -1 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2017-05-15 19:03 UTC (permalink / raw)
  To: Stefan Wahren, Lee Jones, Michael Turquette, Stephen Boyd,
	Florian Fainelli
  Cc: Phil Elwell, linux-clk, linux-kernel, bcm-kernel-feedback-list,
	linux-rpi-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Stefan Wahren <stefan.wahren@i2se.com> writes:

> Hi Eric,
>
>> Eric Anholt <eric@anholt.net> hat am 15. Mai 2017 um 19:35 geschrieben:
>> 
>> 
>> From: Phil Elwell <phil@raspberrypi.org>
>> 
>> 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 <phil@raspberrypi.org>
>> Signed-off-by: Eric Anholt <eric@anholt.net>
>> ---
>> 
>> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* [PATCH] clk: bcm2835: Correct the prediv logic
@ 2017-05-15 19:03     ` Eric Anholt
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2017-05-15 19:03 UTC (permalink / raw)
  To: linux-arm-kernel

Stefan Wahren <stefan.wahren@i2se.com> writes:

> Hi Eric,
>
>> Eric Anholt <eric@anholt.net> hat am 15. Mai 2017 um 19:35 geschrieben:
>> 
>> 
>> From: Phil Elwell <phil@raspberrypi.org>
>> 
>> 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 <phil@raspberrypi.org>
>> Signed-off-by: Eric Anholt <eric@anholt.net>
>> ---
>> 
>> 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>

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

* Re: [PATCH] clk: bcm2835: Correct the prediv logic
  2017-05-15 17:35 ` Eric Anholt
@ 2017-06-02 22:41   ` Stephen Boyd
  -1 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2017-06-02 22:41 UTC (permalink / raw)
  To: Eric Anholt
  Cc: Lee Jones, Florian Fainelli, Michael Turquette, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel, Stefan Wahren,
	bcm-kernel-feedback-list, linux-clk, Phil Elwell

On 05/15, Eric Anholt wrote:
> From: Phil Elwell <phil@raspberrypi.org>
> 
> 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 <phil@raspberrypi.org>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH] clk: bcm2835: Correct the prediv logic
@ 2017-06-02 22:41   ` Stephen Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2017-06-02 22:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/15, Eric Anholt wrote:
> From: Phil Elwell <phil@raspberrypi.org>
> 
> 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 <phil@raspberrypi.org>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2017-06-02 22:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 17:35 [PATCH] clk: bcm2835: Correct the prediv logic Eric Anholt
2017-05-15 17:35 ` Eric Anholt
2017-05-15 17:47 ` Stefan Wahren
2017-05-15 17:47   ` Stefan Wahren
2017-05-15 19:03   ` Eric Anholt
2017-05-15 19:03     ` Eric Anholt
2017-06-02 22:41 ` Stephen Boyd
2017-06-02 22:41   ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.