Skip to contentSkip to conversation

VT8500 clock for 3.10/3.11

PATCH In review Tony Prisk 2 participants 8 messages May 17, 2013 – May 30, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Tony Prisk

author
#0 lore raw

cover VT8500 clock for 3.10/3.11

Hi Mike,

Patch #1 is a fix for 3.10 please - Due to an unbalanced spinlock in vt8500_dclk_set_rate() we get kernel dumps on bootup.

Patch #2 adds support for the PLL clocks on WM8850 - originally it was thought these were the same as WM8750, but with the release of vendor source it's now confirmed to be different.

Patch #3 removes a check (which is also done in vt8500_dclk_round_rate) to ensure the divisor is correct. Due to rounding errors, this usually results in a lower than requested clock rate. Because round_rate is always called on all our clocks, this test is actually redundant so I have dropped it.

Patch #4 is to add clk-vt8500.c to MAINTAINERS

Regards
Tony Prisk

Tony Prisk (4):
clk: vt8500: Fix unbalanced spinlock in vt8500_dclk_set_rate()
clk: vt8500: Add support for clocks on the WM8850 SoCs
clk: vt8500: Remove unnecessary divisor adjustment in
vtwm_dclk_set_rate()
MAINTAINERS: vt8500: Add clk-vt8500.c to MAINTAINERS file

 Documentation/devicetree/bindings/clock/vt8500.txt |    2 +
 MAINTAINERS                                        |    1 +
 drivers/clk/clk-vt8500.c                           |   77 ++++++++++++++++++--
 3 files changed, 75 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/4 clk: vt8500: Fix unbalanced spinlock in vt8500_dclk_set_rate()

With the addition of a DVO clock, a bug is now evident in the vt8500 clock code:

[    0.290000] WARNING: at init/main.c:698 do_one_initcall+0x158/0x18c()
[    0.300000] initcall wm8505fb_driver_init+0x0/0xc returned with disabled int

This is caused by an unbalanced spinlock in vt8500_dclk_set_rate(). Replace the second call to spin_lock_irqsave() with spin_unlock_irqrestore().

---
 drivers/clk/clk-vt8500.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-vt8500.c +1 -1
index debf688..553ac35 100644
@@ -183,7 +183,7 @@ static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
 	writel(divisor, cdev->div_reg);
 	vt8500_pmc_wait_busy();
 
-	spin_lock_irqsave(cdev->lock, flags);
+	spin_unlock_irqrestore(cdev->lock, flags);
 
 	return 0;
 }
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/4 clk: vt8500: Add support for clocks on the WM8850 SoCs

In reply to Tony Prisk

The WM8850 has a different PLL clock to the previous versions. This patch adds support for the WM8850-style PLL clocks.

---
 Documentation/devicetree/bindings/clock/vt8500.txt |    2 +
 drivers/clk/clk-vt8500.c                           |   71 ++++++++++++++++++++
 2 files changed, 73 insertions(+)
Documentation/devicetree/bindings/clock/vt8500.txt +2 -0
index a880c70..91d71cc 100644
@@ -8,6 +8,8 @@ Required properties:
 - compatible : shall be one of the following:
 	"via,vt8500-pll-clock" - for a VT8500/WM8505 PLL clock
 	"wm,wm8650-pll-clock" - for a WM8650 PLL clock
+	"wm,wm8750-pll-clock" - for a WM8750 PLL clock
+	"wm,wm8850-pll-clock" - for a WM8850 PLL clock
 	"via,vt8500-device-clock" - for a VT/WM device clock
 
 Required properties for PLL clocks:
drivers/clk/clk-vt8500.c +71 -0

113 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH 3/4 clk: vt8500: Remove unnecessary divisor adjustment in vtwm_dclk_set_rate()

In reply to Tony Prisk

The divisor adjustment code to ensure that a divisor is not rounded down, thereby giving a rate higher than requested, is unnecessary and in some instances results in the actual rate being much lower than requested due to rounding errors.

The test is already performed in vtwm_dclk_round_rate(), which is always called when clk_set_rate is called. Due to rounding errors in the line:
divisor = parent_rate / rate (clk-vt8500.c:160) we will sometimes end up adjusting the divisor twice - first in round_rate and then again in set_rate.

This patch removes the test/adjustment in vtwm_dclk_set_rate.

---
 drivers/clk/clk-vt8500.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/clk/clk-vt8500.c +0 -4
index ce401cf..82306f5 100644
@@ -157,10 +157,6 @@ static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
 
 	divisor =  parent_rate / rate;
 
-	/* If prate / rate would be decimal, incr the divisor */
-	if (rate * divisor < parent_rate)
-		divisor++;
-
 	if (divisor == cdev->div_mask + 1)
 		divisor = 0;
 
Signature · 1 line
1.7.9.5
author
#4 lore raw

PATCH 4/4 MAINTAINERS: vt8500: Add clk-vt8500.c to MAINTAINERS file

In reply to Tony Prisk

This file has missed being added under ARM/VT8500 ARM ARCHITECTURE, and is maintained along with the rest of the vt8500 arch code.

---
 MAINTAINERS |    1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 3d7782b..5ab8ccb 100644
@@ -1283,6 +1283,7 @@ M:	Tony Prisk <[email protected]>
 L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
 S:	Maintained
 F:	arch/arm/mach-vt8500/
+F:	drivers/clk/vt8500-vt8500.c
 F:	drivers/clocksource/vt8500_timer.c
 F:	drivers/gpio/gpio-vt8500.c
 F:	drivers/mmc/host/wmt-sdmmc.c
Signature · 1 line
1.7.9.5

A message that is not in the archive (sent off-list or not yet received): CABjd4Yw2LbnaUbQFW_bd_6WRGTA34-Vp_tUC2b4Jczj-MM8x1w@mail.gmail.com

author
#6 lore raw

Re: [PATCH 4/4] MAINTAINERS: vt8500: Add clk-vt8500.c to MAINTAINERS file

Quoted 16 lines · Alexey Charkov
Quoted 13 lines · Tony Prisk

This file has missed being added under ARM/VT8500 ARM ARCHITECTURE, and is maintained along with the rest of the vt8500 arch code.

---
  MAINTAINERS |    1 +
  1 file changed, 1 insertion(+)
MAINTAINERS +0 -0
index 3d7782b..5ab8ccb 100644

MAINTAINERS M: Tony Prisk <[email protected]> · line 1283

Quoted 1 line
MAINTAINERS +0 -0
@@ -1283,6 +1283,7 @@ M:        Tony Prisk <[email protected]>
  L:     linux-arm-kernel at lists.infradead.org (moderated for

non-subscribers)

Quoted 8 lines

MAINTAINERS M: Tony Prisk <[email protected]> · line 1286

Quoted 3 lines
MAINTAINERS +1 -0
  S:     Maintained
  F:     arch/arm/mach-vt8500/
+F:     drivers/clk/vt8500-vt8500.c

This looks like a typo (clk vs. vt8500).

Best,
Alexey

eeek - oops.

Mike,

Disregard this patch - I will send a more complete one through arm-soc as there are other files missing as well.

Regards
Tony P

#7 lore raw

Re: [PATCH 4/4] MAINTAINERS: vt8500: Add clk-vt8500.c to MAINTAINERS file

Quoting Tony Prisk (2013-05-18 01:30:21)

Quoted 25 lines · Alexey Charkov
Quoted 16 lines · Tony Prisk
Quoted 13 lines

This file has missed being added under ARM/VT8500 ARM ARCHITECTURE, and is maintained along with the rest of the vt8500 arch code.

---
  MAINTAINERS |    1 +
  1 file changed, 1 insertion(+)
MAINTAINERS +0 -0
index 3d7782b..5ab8ccb 100644

MAINTAINERS M: Tony Prisk <[email protected]> · line 1283

Quoted 1 line
MAINTAINERS +0 -0
@@ -1283,6 +1283,7 @@ M:        Tony Prisk <[email protected]>
  L:     linux-arm-kernel at lists.infradead.org (moderated for

non-subscribers)

Quoted 8 lines

MAINTAINERS M: Tony Prisk <[email protected]> · line 1286

Quoted 3 lines
MAINTAINERS +1 -0
  S:     Maintained
  F:     arch/arm/mach-vt8500/
+F:     drivers/clk/vt8500-vt8500.c

This looks like a typo (clk vs. vt8500).

Best,
Alexey

Quoted 7 lines

eeek - oops.

Mike,

Disregard this patch - I will send a more complete one through arm-soc as there are other files missing as well.

Hi Tony,

I've taken patch #1 into clk-fixes. I took patches #2 & #3 into clk-next from your previous series posted on May 13, which appear identical to the ones in this series. In the future could you put a "v2" in the patch subject since those patches were re-posted? It would have helped me catch it.

I have not taken patch #4.

Does this all sound correct to you?

Thanks,
Mike

Quoted 2 lines

Regards
Tony P

author
#8 lore raw

Re: [PATCH 4/4] MAINTAINERS: vt8500: Add clk-vt8500.c to MAINTAINERS file

Quoted 41 lines · Mike Turquette

Quoting Tony Prisk (2013-05-18 01:30:21)

Quoted 25 lines · Alexey Charkov
Quoted 16 lines · Tony Prisk
Quoted 13 lines

This file has missed being added under ARM/VT8500 ARM ARCHITECTURE, and is maintained along with the rest of the vt8500 arch code.

---
   MAINTAINERS |    1 +
   1 file changed, 1 insertion(+)
MAINTAINERS +0 -0
index 3d7782b..5ab8ccb 100644

MAINTAINERS M: Tony Prisk <[email protected]> · line 1283

Quoted 1 line
MAINTAINERS +0 -0
@@ -1283,6 +1283,7 @@ M:        Tony Prisk <[email protected]>
   L:     linux-arm-kernel at lists.infradead.org (moderated for

non-subscribers)

Quoted 8 lines

MAINTAINERS M: Tony Prisk <[email protected]> · line 1286

Quoted 3 lines
MAINTAINERS +1 -0
   S:     Maintained
   F:     arch/arm/mach-vt8500/
+F:     drivers/clk/vt8500-vt8500.c

This looks like a typo (clk vs. vt8500).

Best,
Alexey

Quoted 7 lines

eeek - oops.

Mike,

Disregard this patch - I will send a more complete one through arm-soc as there are other files missing as well.

Hi Tony,

I've taken patch #1 into clk-fixes. I took patches #2 & #3 into clk-next from your previous series posted on May 13, which appear identical to the ones in this series. In the future could you put a "v2" in the patch subject since those patches were re-posted? It would have helped me catch it.

Quoted 9 lines

I have not taken patch #4.

Does this all sound correct to you?

Thanks,
Mike

Quoted 2 lines

Regards
Tony P

Perfect - Thanks Mike

Regards
Tony P