linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] Fix dmtimer parent clock setup
@ 2018-07-16 20:38 Neil Armstrong
  2018-07-16 20:38 ` [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks Neil Armstrong
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Neil Armstrong @ 2018-07-16 20:38 UTC (permalink / raw)
  To: tony, daniel.lezcano
  Cc: Neil Armstrong, linux-omap, linux-kernel, aford173, drivshin

With the move to clocksource, the omap_dm_timer_of_set_source() broke
because the "fclk" clock is now defined in the DT.
The omap_dm_timer_of_set_source() was using the first clock declared in the
timer node, but now this clock must be named as "src" and clk_get() use
"src" as clock name to permit specifiying the parent clock of the timer "fclk".

The 3 first patches adds the "fck" clocks to all timer nodes of SoCs using
the Clock Framework to pass this clock to the dmtimer driver.

Adam, David, can you check if this solves the issue reported at [1] ?

[1] https://www.spinics.net/lists/linux-clk/msg27638.html

Neil Armstrong (4):
  ARM: dts: am33xx: Add all fck timer clocks
  ARM: dts: am4372: Add all fck timer clocks
  ARM: dts: dm816x: Add all fck timer clocks
  timer-ti-dm: Fix omap_dm_timer_of_set_source()

 arch/arm/boot/dts/am33xx.dtsi     | 10 ++++++++++
 arch/arm/boot/dts/am4372.dtsi     | 18 ++++++++++++++++++
 arch/arm/boot/dts/dm816x.dtsi     | 10 ++++++++++
 drivers/clocksource/timer-ti-dm.c |  2 +-
 4 files changed, 39 insertions(+), 1 deletion(-)

-- 
2.7.4


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

* [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks
  2018-07-16 20:38 [RFC PATCH 0/4] Fix dmtimer parent clock setup Neil Armstrong
@ 2018-07-16 20:38 ` Neil Armstrong
  2018-07-17  5:55   ` Tony Lindgren
  2018-07-16 20:39 ` [RFC PATCH 2/4] ARM: dts: am4372: " Neil Armstrong
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Neil Armstrong @ 2018-07-16 20:38 UTC (permalink / raw)
  To: tony, daniel.lezcano
  Cc: Neil Armstrong, linux-omap, linux-kernel, aford173, drivshin

Add the missing fck clock to all timer nodes of the AM33XX dtsi.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm/boot/dts/am33xx.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 9cd62bc2..e8e665d 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -541,6 +541,8 @@
 			reg = <0x48042000 0x400>;
 			interrupts = <69>;
 			ti,hwmods = "timer3";
+			clocks = <&timer3_fck>;
+			clock-names = "fck";
 		};
 
 		timer4: timer@48044000 {
@@ -548,6 +550,8 @@
 			reg = <0x48044000 0x400>;
 			interrupts = <92>;
 			ti,hwmods = "timer4";
+			clocks = <&timer4_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
@@ -556,6 +560,8 @@
 			reg = <0x48046000 0x400>;
 			interrupts = <93>;
 			ti,hwmods = "timer5";
+			clocks = <&timer5_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
@@ -564,6 +570,8 @@
 			reg = <0x48048000 0x400>;
 			interrupts = <94>;
 			ti,hwmods = "timer6";
+			clocks = <&timer6_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
@@ -572,6 +580,8 @@
 			reg = <0x4804a000 0x400>;
 			interrupts = <95>;
 			ti,hwmods = "timer7";
+			clocks = <&timer7_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
-- 
2.7.4


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

* [RFC PATCH 2/4] ARM: dts: am4372: Add all fck timer clocks
  2018-07-16 20:38 [RFC PATCH 0/4] Fix dmtimer parent clock setup Neil Armstrong
  2018-07-16 20:38 ` [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks Neil Armstrong
@ 2018-07-16 20:39 ` Neil Armstrong
  2018-07-16 20:39 ` [RFC PATCH 3/4] ARM: dts: dm816x: " Neil Armstrong
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2018-07-16 20:39 UTC (permalink / raw)
  To: tony, daniel.lezcano
  Cc: Neil Armstrong, linux-omap, linux-kernel, aford173, drivshin

Add the missing fck clock to all timer nodes of the AM4372 dtsi.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm/boot/dts/am4372.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index f0cbd86..254c0e6 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -383,6 +383,8 @@
 			reg = <0x48042000 0x400>;
 			interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "timer3";
+			clocks = <&timer3_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -392,6 +394,8 @@
 			interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
 			ti,timer-pwm;
 			ti,hwmods = "timer4";
+			clocks = <&timer4_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -401,6 +405,8 @@
 			interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
 			ti,timer-pwm;
 			ti,hwmods = "timer5";
+			clocks = <&timer5_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -410,6 +416,8 @@
 			interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
 			ti,timer-pwm;
 			ti,hwmods = "timer6";
+			clocks = <&timer6_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -419,6 +427,8 @@
 			interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
 			ti,timer-pwm;
 			ti,hwmods = "timer7";
+			clocks = <&timer7_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -427,6 +437,8 @@
 			reg = <0x481c1000 0x400>;
 			interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "timer8";
+			clocks = <&timer8_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -435,6 +447,8 @@
 			reg = <0x4833d000 0x400>;
 			interrupts = <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "timer9";
+			clocks = <&timer9_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -443,6 +457,8 @@
 			reg = <0x4833f000 0x400>;
 			interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "timer10";
+			clocks = <&timer10_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
@@ -451,6 +467,8 @@
 			reg = <0x48341000 0x400>;
 			interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "timer11";
+			clocks = <&timer11_fck>;
+			clock-names = "fck";
 			status = "disabled";
 		};
 
-- 
2.7.4


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

* [RFC PATCH 3/4] ARM: dts: dm816x: Add all fck timer clocks
  2018-07-16 20:38 [RFC PATCH 0/4] Fix dmtimer parent clock setup Neil Armstrong
  2018-07-16 20:38 ` [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks Neil Armstrong
  2018-07-16 20:39 ` [RFC PATCH 2/4] ARM: dts: am4372: " Neil Armstrong
@ 2018-07-16 20:39 ` Neil Armstrong
  2018-07-16 20:39 ` [RFC PATCH 4/4] timer-ti-dm: Fix omap_dm_timer_of_set_source() Neil Armstrong
  2018-07-16 23:21 ` [RFC PATCH 0/4] Fix dmtimer parent clock setup David Rivshin
  4 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2018-07-16 20:39 UTC (permalink / raw)
  To: tony, daniel.lezcano
  Cc: Neil Armstrong, linux-omap, linux-kernel, aford173, drivshin

Add the missing fck clock to all timer nodes of the DM816X dtsi.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm/boot/dts/dm816x.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index 1edc2b4..0cc7f17 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -352,6 +352,8 @@
 			reg = <0x48042000 0x2000>;
 			interrupts = <69>;
 			ti,hwmods = "timer3";
+			clocks = <&timer3_fck>;
+			clock-names = "fck";
 		};
 
 		timer4: timer@48044000 {
@@ -359,6 +361,8 @@
 			reg = <0x48044000 0x2000>;
 			interrupts = <92>;
 			ti,hwmods = "timer4";
+			clocks = <&timer4_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
@@ -367,6 +371,8 @@
 			reg = <0x48046000 0x2000>;
 			interrupts = <93>;
 			ti,hwmods = "timer5";
+			clocks = <&timer5_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
@@ -375,6 +381,8 @@
 			reg = <0x48048000 0x2000>;
 			interrupts = <94>;
 			ti,hwmods = "timer6";
+			clocks = <&timer6_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
@@ -383,6 +391,8 @@
 			reg = <0x4804a000 0x2000>;
 			interrupts = <95>;
 			ti,hwmods = "timer7";
+			clocks = <&timer7_fck>;
+			clock-names = "fck";
 			ti,timer-pwm;
 		};
 
-- 
2.7.4


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

* [RFC PATCH 4/4] timer-ti-dm: Fix omap_dm_timer_of_set_source()
  2018-07-16 20:38 [RFC PATCH 0/4] Fix dmtimer parent clock setup Neil Armstrong
                   ` (2 preceding siblings ...)
  2018-07-16 20:39 ` [RFC PATCH 3/4] ARM: dts: dm816x: " Neil Armstrong
@ 2018-07-16 20:39 ` Neil Armstrong
  2018-07-16 23:21 ` [RFC PATCH 0/4] Fix dmtimer parent clock setup David Rivshin
  4 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2018-07-16 20:39 UTC (permalink / raw)
  To: tony, daniel.lezcano
  Cc: Neil Armstrong, linux-omap, linux-kernel, aford173, drivshin

With the move to clocksource, the omap_dm_timer_of_set_source() broke
because the "fclk" clock is now defined in the DT.
The omap_dm_timer_of_set_source() was using the first clock declared in the
timer node, but now this clock must be named as "src" and clk_get() use
"src" as clock name to permit specifiying the parent clock of the timer "fclk".

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/clocksource/timer-ti-dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index 4cce6b2..868bc78 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -150,7 +150,7 @@ static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
 	if (!timer->fclk)
 		return -ENODEV;
 
-	parent = clk_get(&timer->pdev->dev, NULL);
+	parent = clk_get(&timer->pdev->dev, "src");
 	if (IS_ERR(parent))
 		return -ENODEV;
 
-- 
2.7.4


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

* Re: [RFC PATCH 0/4] Fix dmtimer parent clock setup
  2018-07-16 20:38 [RFC PATCH 0/4] Fix dmtimer parent clock setup Neil Armstrong
                   ` (3 preceding siblings ...)
  2018-07-16 20:39 ` [RFC PATCH 4/4] timer-ti-dm: Fix omap_dm_timer_of_set_source() Neil Armstrong
@ 2018-07-16 23:21 ` David Rivshin
  4 siblings, 0 replies; 9+ messages in thread
From: David Rivshin @ 2018-07-16 23:21 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: tony, daniel.lezcano, linux-omap, linux-kernel, aford173

On Mon, 16 Jul 2018 22:38:58 +0200
Neil Armstrong <narmstrong@baylibre.com> wrote:

> With the move to clocksource, the omap_dm_timer_of_set_source() broke
> because the "fclk" clock is now defined in the DT.
> The omap_dm_timer_of_set_source() was using the first clock declared in the
> timer node, but now this clock must be named as "src" and clk_get() use
> "src" as clock name to permit specifiying the parent clock of the timer "fclk".
> 
> The 3 first patches adds the "fck" clocks to all timer nodes of SoCs using
> the Clock Framework to pass this clock to the dmtimer driver.
> 
> Adam, David, can you check if this solves the issue reported at [1] ?

Thanks! Works on my AM335x board.
Patches 1 and 4:
 Tested-by: David Rivshin <drivshin@allworx.com>

If I might suggest also:
 Fixes: df54bfc5502a ("clk: ti: am33xx: add clkctrl clock data")
 Cc: <stable@vger.kernel.org> # 4.16+


> 
> [1] https://www.spinics.net/lists/linux-clk/msg27638.html
> 
> Neil Armstrong (4):
>   ARM: dts: am33xx: Add all fck timer clocks
>   ARM: dts: am4372: Add all fck timer clocks
>   ARM: dts: dm816x: Add all fck timer clocks
>   timer-ti-dm: Fix omap_dm_timer_of_set_source()
> 
>  arch/arm/boot/dts/am33xx.dtsi     | 10 ++++++++++
>  arch/arm/boot/dts/am4372.dtsi     | 18 ++++++++++++++++++
>  arch/arm/boot/dts/dm816x.dtsi     | 10 ++++++++++
>  drivers/clocksource/timer-ti-dm.c |  2 +-
>  4 files changed, 39 insertions(+), 1 deletion(-)
> 


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

* Re: [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks
  2018-07-16 20:38 ` [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks Neil Armstrong
@ 2018-07-17  5:55   ` Tony Lindgren
  2018-07-17 20:28     ` Neil Armstrong
  0 siblings, 1 reply; 9+ messages in thread
From: Tony Lindgren @ 2018-07-17  5:55 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: daniel.lezcano, linux-omap, linux-kernel, aford173, drivshin

Hi,

* Neil Armstrong <narmstrong@baylibre.com> [180716 20:42]:
> Add the missing fck clock to all timer nodes of the AM33XX dtsi.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  arch/arm/boot/dts/am33xx.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
> index 9cd62bc2..e8e665d 100644
> --- a/arch/arm/boot/dts/am33xx.dtsi
> +++ b/arch/arm/boot/dts/am33xx.dtsi
> @@ -541,6 +541,8 @@
>  			reg = <0x48042000 0x400>;
>  			interrupts = <69>;
>  			ti,hwmods = "timer3";
> +			clocks = <&timer3_fck>;
> +			clock-names = "fck";
>  		};

These should all use the clkctrl clock nodes, see:

$ git grep CLKCTRL include/dt-bindings/clock/ | grep TIMER

The module clock is bit 0, and on some SoCs bit 24 is the
timer fck. But I don't think these SoS use separate bit 24
clock.

Regards,

Tony

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

* Re: [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks
  2018-07-17  5:55   ` Tony Lindgren
@ 2018-07-17 20:28     ` Neil Armstrong
  2018-07-19  6:42       ` Tony Lindgren
  0 siblings, 1 reply; 9+ messages in thread
From: Neil Armstrong @ 2018-07-17 20:28 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: daniel.lezcano, linux-omap, linux-kernel, aford173, drivshin

Hi Tony,

On 17/07/2018 07:55, Tony Lindgren wrote:
> Hi,
> 
> * Neil Armstrong <narmstrong@baylibre.com> [180716 20:42]:
>> Add the missing fck clock to all timer nodes of the AM33XX dtsi.
>>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> ---
>>  arch/arm/boot/dts/am33xx.dtsi | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
>> index 9cd62bc2..e8e665d 100644
>> --- a/arch/arm/boot/dts/am33xx.dtsi
>> +++ b/arch/arm/boot/dts/am33xx.dtsi
>> @@ -541,6 +541,8 @@
>>  			reg = <0x48042000 0x400>;
>>  			interrupts = <69>;
>>  			ti,hwmods = "timer3";
>> +			clocks = <&timer3_fck>;
>> +			clock-names = "fck";
>>  		};
> 
> These should all use the clkctrl clock nodes, see:

Even the already configured timer1 & timer2 ?

> 
> $ git grep CLKCTRL include/dt-bindings/clock/ | grep TIMER
> 
> The module clock is bit 0, and on some SoCs bit 24 is the
> timer fck. But I don't think these SoS use separate bit 24
> clock.
> 
> Regards,
> 
> Tony
> 


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

* Re: [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks
  2018-07-17 20:28     ` Neil Armstrong
@ 2018-07-19  6:42       ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2018-07-19  6:42 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: daniel.lezcano, linux-omap, linux-kernel, aford173, drivshin

* Neil Armstrong <narmstrong@baylibre.com> [180717 20:31]:
> On 17/07/2018 07:55, Tony Lindgren wrote:
> > These should all use the clkctrl clock nodes, see:
> 
> Even the already configured timer1 & timer2 ?

Yeah that way things will work in a generic way for the SoCs
using clkctrl registers. That's omap4 and later and including
ti81xx.

Regards,

Tony

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

end of thread, other threads:[~2018-07-19  6:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-16 20:38 [RFC PATCH 0/4] Fix dmtimer parent clock setup Neil Armstrong
2018-07-16 20:38 ` [RFC PATCH 1/4] ARM: dts: am33xx: Add all fck timer clocks Neil Armstrong
2018-07-17  5:55   ` Tony Lindgren
2018-07-17 20:28     ` Neil Armstrong
2018-07-19  6:42       ` Tony Lindgren
2018-07-16 20:39 ` [RFC PATCH 2/4] ARM: dts: am4372: " Neil Armstrong
2018-07-16 20:39 ` [RFC PATCH 3/4] ARM: dts: dm816x: " Neil Armstrong
2018-07-16 20:39 ` [RFC PATCH 4/4] timer-ti-dm: Fix omap_dm_timer_of_set_source() Neil Armstrong
2018-07-16 23:21 ` [RFC PATCH 0/4] Fix dmtimer parent clock setup David Rivshin

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