linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] More Allwinner SoC timer fixes
@ 2013-10-25 11:16 Maxime Ripard
  2013-10-25 11:16 ` [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure Maxime Ripard
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Maxime Ripard @ 2013-10-25 11:16 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, linux-arm-kernel, sboyd, Maxime Ripard

Hi,

Here are more fixes to the sun4i timer that we spotted during the review of the
High Speed timers patches, and that we hunted down during the Kernel Summit.

Since they are not critical fixes for the current code we have, it doesn't have
to be merged in 3.12 and can wait.

Thanks!
Maxime

Maxime Ripard (2):
  clockevent: sun4i: Fill the irq field in the clockevent structure
  clocksource: sun4i: change CPU mask to cpu_possible_mask

 drivers/clocksource/sun4i_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
1.8.4


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

* [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure
  2013-10-25 11:16 [PATCH 0/2] More Allwinner SoC timer fixes Maxime Ripard
@ 2013-10-25 11:16 ` Maxime Ripard
  2013-10-28 16:19   ` Stephen Boyd
  2013-11-07 10:17   ` Daniel Lezcano
  2013-10-25 11:16 ` [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask Maxime Ripard
  2013-11-05 23:38 ` [PATCH 0/2] More Allwinner SoC timer fixes Daniel Lezcano
  2 siblings, 2 replies; 9+ messages in thread
From: Maxime Ripard @ 2013-10-25 11:16 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, linux-arm-kernel, sboyd, Maxime Ripard

The clock event structure irq field was not filled previously to the
interrupt we're using.

This was resulting in the timer not being used at all when using a
configuration with SMP enabled on a system with several CPUs, and with
the cpumask set to the cpu_possible_mask.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clocksource/sun4i_timer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c
index 2fb4695..a7f492e 100644
--- a/drivers/clocksource/sun4i_timer.c
+++ b/drivers/clocksource/sun4i_timer.c
@@ -188,6 +188,7 @@ static void __init sun4i_timer_init(struct device_node *node)
 	writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
 
 	sun4i_clockevent.cpumask = cpumask_of(0);
+	sun4i_clockevent.irq = irq;
 
 	clockevents_config_and_register(&sun4i_clockevent, rate,
 					TIMER_SYNC_TICKS, 0xffffffff);
-- 
1.8.4


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

* [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask
  2013-10-25 11:16 [PATCH 0/2] More Allwinner SoC timer fixes Maxime Ripard
  2013-10-25 11:16 ` [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure Maxime Ripard
@ 2013-10-25 11:16 ` Maxime Ripard
  2013-10-28 16:19   ` Stephen Boyd
  2013-11-07 10:19   ` Daniel Lezcano
  2013-11-05 23:38 ` [PATCH 0/2] More Allwinner SoC timer fixes Daniel Lezcano
  2 siblings, 2 replies; 9+ messages in thread
From: Maxime Ripard @ 2013-10-25 11:16 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, linux-arm-kernel, sboyd, Maxime Ripard

The interrupt for the timer is a shared processor interrupt, so any CPU
found in the system can handle it. Switch to our cpumask to
cpu_possible_mask instead of cpumask_of(0).

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clocksource/sun4i_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c
index a7f492e..6a76b4e 100644
--- a/drivers/clocksource/sun4i_timer.c
+++ b/drivers/clocksource/sun4i_timer.c
@@ -187,7 +187,7 @@ static void __init sun4i_timer_init(struct device_node *node)
 	val = readl(timer_base + TIMER_IRQ_EN_REG);
 	writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
 
-	sun4i_clockevent.cpumask = cpumask_of(0);
+	sun4i_clockevent.cpumask = cpu_possible_mask;
 	sun4i_clockevent.irq = irq;
 
 	clockevents_config_and_register(&sun4i_clockevent, rate,
-- 
1.8.4


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

* Re: [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure
  2013-10-25 11:16 ` [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure Maxime Ripard
@ 2013-10-28 16:19   ` Stephen Boyd
  2013-11-07 10:17   ` Daniel Lezcano
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2013-10-28 16:19 UTC (permalink / raw)
  To: Maxime Ripard, daniel.lezcano, tglx; +Cc: linux-kernel, linux-arm-kernel

On 10/25/13 04:16, Maxime Ripard wrote:
> The clock event structure irq field was not filled previously to the
> interrupt we're using.
>
> This was resulting in the timer not being used at all when using a
> configuration with SMP enabled on a system with several CPUs, and with
> the cpumask set to the cpu_possible_mask.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


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

* Re: [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask
  2013-10-25 11:16 ` [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask Maxime Ripard
@ 2013-10-28 16:19   ` Stephen Boyd
  2013-11-07 10:19   ` Daniel Lezcano
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2013-10-28 16:19 UTC (permalink / raw)
  To: Maxime Ripard, daniel.lezcano, tglx; +Cc: linux-kernel, linux-arm-kernel

On 10/25/13 04:16, Maxime Ripard wrote:
> The interrupt for the timer is a shared processor interrupt, so any CPU
> found in the system can handle it. Switch to our cpumask to
> cpu_possible_mask instead of cpumask_of(0).
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


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

* Re: [PATCH 0/2] More Allwinner SoC timer fixes
  2013-10-25 11:16 [PATCH 0/2] More Allwinner SoC timer fixes Maxime Ripard
  2013-10-25 11:16 ` [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure Maxime Ripard
  2013-10-25 11:16 ` [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask Maxime Ripard
@ 2013-11-05 23:38 ` Daniel Lezcano
  2 siblings, 0 replies; 9+ messages in thread
From: Daniel Lezcano @ 2013-11-05 23:38 UTC (permalink / raw)
  To: Maxime Ripard, tglx; +Cc: linux-kernel, linux-arm-kernel, sboyd

On 10/25/2013 01:16 PM, Maxime Ripard wrote:
> Hi,
>
> Here are more fixes to the sun4i timer that we spotted during the review of the
> High Speed timers patches, and that we hunted down during the Kernel Summit.
>
> Since they are not critical fixes for the current code we have, it doesn't have
> to be merged in 3.12 and can wait.
>
> Thanks!
> Maxime
>
> Maxime Ripard (2):
>    clockevent: sun4i: Fill the irq field in the clockevent structure
>    clocksource: sun4i: change CPU mask to cpu_possible_mask
>
>   drivers/clocksource/sun4i_timer.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>

Hi Maxime,

just a head up to tell I have been very busy last week for the Linaro 
connect. I will take care of the patches tomorrow.

Thanks
   -- Daniel

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure
  2013-10-25 11:16 ` [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure Maxime Ripard
  2013-10-28 16:19   ` Stephen Boyd
@ 2013-11-07 10:17   ` Daniel Lezcano
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel Lezcano @ 2013-11-07 10:17 UTC (permalink / raw)
  To: Maxime Ripard, tglx; +Cc: linux-kernel, linux-arm-kernel, sboyd

On 10/25/2013 01:16 PM, Maxime Ripard wrote:
> The clock event structure irq field was not filled previously to the
> interrupt we're using.
>
> This was resulting in the timer not being used at all when using a
> configuration with SMP enabled on a system with several CPUs, and with
> the cpumask set to the cpu_possible_mask.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied to my tree for 3.14

> ---
>   drivers/clocksource/sun4i_timer.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c
> index 2fb4695..a7f492e 100644
> --- a/drivers/clocksource/sun4i_timer.c
> +++ b/drivers/clocksource/sun4i_timer.c
> @@ -188,6 +188,7 @@ static void __init sun4i_timer_init(struct device_node *node)
>   	writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
>
>   	sun4i_clockevent.cpumask = cpumask_of(0);
> +	sun4i_clockevent.irq = irq;
>
>   	clockevents_config_and_register(&sun4i_clockevent, rate,
>   					TIMER_SYNC_TICKS, 0xffffffff);
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask
  2013-10-25 11:16 ` [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask Maxime Ripard
  2013-10-28 16:19   ` Stephen Boyd
@ 2013-11-07 10:19   ` Daniel Lezcano
  2013-11-10  9:52     ` Maxime Ripard
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Lezcano @ 2013-11-07 10:19 UTC (permalink / raw)
  To: Maxime Ripard, tglx; +Cc: linux-kernel, linux-arm-kernel, sboyd

On 10/25/2013 01:16 PM, Maxime Ripard wrote:
> The interrupt for the timer is a shared processor interrupt, so any CPU
> found in the system can handle it. Switch to our cpumask to
> cpu_possible_mask instead of cpumask_of(0).
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied to my tree for 3.14

Thanks !

sidenote: did you look at the CLOCK_EVT_FEAT_DYNIRQ flag ? It may reduce 
the number of wakeup for your system.

> ---
>   drivers/clocksource/sun4i_timer.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c
> index a7f492e..6a76b4e 100644
> --- a/drivers/clocksource/sun4i_timer.c
> +++ b/drivers/clocksource/sun4i_timer.c
> @@ -187,7 +187,7 @@ static void __init sun4i_timer_init(struct device_node *node)
>   	val = readl(timer_base + TIMER_IRQ_EN_REG);
>   	writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
>
> -	sun4i_clockevent.cpumask = cpumask_of(0);
> +	sun4i_clockevent.cpumask = cpu_possible_mask;
>   	sun4i_clockevent.irq = irq;
>
>   	clockevents_config_and_register(&sun4i_clockevent, rate,
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask
  2013-11-07 10:19   ` Daniel Lezcano
@ 2013-11-10  9:52     ` Maxime Ripard
  0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2013-11-10  9:52 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: tglx, linux-kernel, linux-arm-kernel, sboyd

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

Hi Daniel,

On Thu, Nov 07, 2013 at 11:19:41AM +0100, Daniel Lezcano wrote:
> On 10/25/2013 01:16 PM, Maxime Ripard wrote:
> >The interrupt for the timer is a shared processor interrupt, so any CPU
> >found in the system can handle it. Switch to our cpumask to
> >cpu_possible_mask instead of cpumask_of(0).
> >
> >Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> 
> Applied to my tree for 3.14

Thanks!

> sidenote: did you look at the CLOCK_EVT_FEAT_DYNIRQ flag ? It may
> reduce the number of wakeup for your system.

Not yet, but I'll give it a look for sure :)

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-11-10  9:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-25 11:16 [PATCH 0/2] More Allwinner SoC timer fixes Maxime Ripard
2013-10-25 11:16 ` [PATCH 1/2] clockevent: sun4i: Fill the irq field in the clockevent structure Maxime Ripard
2013-10-28 16:19   ` Stephen Boyd
2013-11-07 10:17   ` Daniel Lezcano
2013-10-25 11:16 ` [PATCH 2/2] clocksource: sun4i: change CPU mask to cpu_possible_mask Maxime Ripard
2013-10-28 16:19   ` Stephen Boyd
2013-11-07 10:19   ` Daniel Lezcano
2013-11-10  9:52     ` Maxime Ripard
2013-11-05 23:38 ` [PATCH 0/2] More Allwinner SoC timer fixes Daniel Lezcano

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