linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ARM: at91: rm9200 fix time support
@ 2013-05-05 20:13 Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-05 20:13 UTC (permalink / raw)
  To: linux-arm-kernel

since commit 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488
Author: Shawn Guo <shawn.guo@linaro.org>
Date:   Sat Jan 12 11:50:05 2013 +0000

ARM: use clockevents_config_and_register() where possible

The timer is wrongly configured and result in since crash
so revert it on rm9200 timer

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
Hi Greg,

	if possible apply it to v3.8 and v3.9 stable

	I'll apply it for mainline

Best Regards,
J.
 arch/arm/mach-at91/at91rm9200_time.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 2acdff4..180b302 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -174,6 +174,7 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
 static struct clock_event_device clkevt = {
 	.name		= "at91_tick",
 	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+	.shift		= 32,
 	.rating		= 150,
 	.set_next_event	= clkevt32k_next_event,
 	.set_mode	= clkevt32k_mode,
@@ -264,9 +265,11 @@ void __init at91rm9200_timer_init(void)
 	at91_st_write(AT91_ST_RTMR, 1);
 
 	/* Setup timer clockevent, with minimum of two ticks (important!!) */
+	clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
+	clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
+	clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
 	clkevt.cpumask = cpumask_of(0);
-	clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
-					2, AT91_ST_ALMV);
+	clockevents_register_device(&clkevt);
 
 	/* register clocksource */
 	clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
-- 
1.7.10.4

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

* [PATCH 1/1] ARM: at91: rm9200 fix time support
@ 2013-05-05 20:20 Jean-Christophe PLAGNIOL-VILLARD
  2013-05-05 21:26 ` Greg KH
  2013-05-15 10:08 ` Nicolas Ferre
  0 siblings, 2 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-05 20:20 UTC (permalink / raw)
  To: linux-arm-kernel

since commit 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488
Author: Shawn Guo <shawn.guo@linaro.org>
Date:   Sat Jan 12 11:50:05 2013 +0000

ARM: use clockevents_config_and_register() where possible

The timer is wrongly configured and result in since crash
so revert it on rm9200 timer

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
Hi Greg,

	if possible apply it to v3.8 and v3.9 stable

	I'll apply it for mainline

Best Regards,
J.
 arch/arm/mach-at91/at91rm9200_time.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 2acdff4..180b302 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -174,6 +174,7 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
 static struct clock_event_device clkevt = {
 	.name		= "at91_tick",
 	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+	.shift		= 32,
 	.rating		= 150,
 	.set_next_event	= clkevt32k_next_event,
 	.set_mode	= clkevt32k_mode,
@@ -264,9 +265,11 @@ void __init at91rm9200_timer_init(void)
 	at91_st_write(AT91_ST_RTMR, 1);
 
 	/* Setup timer clockevent, with minimum of two ticks (important!!) */
+	clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
+	clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
+	clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
 	clkevt.cpumask = cpumask_of(0);
-	clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
-					2, AT91_ST_ALMV);
+	clockevents_register_device(&clkevt);
 
 	/* register clocksource */
 	clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
-- 
1.7.10.4

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

* [PATCH 1/1] ARM: at91: rm9200 fix time support
  2013-05-05 20:20 Jean-Christophe PLAGNIOL-VILLARD
@ 2013-05-05 21:26 ` Greg KH
  2013-05-15 10:08 ` Nicolas Ferre
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2013-05-05 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 05, 2013 at 10:20:25PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> since commit 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488
> Author: Shawn Guo <shawn.guo@linaro.org>
> Date:   Sat Jan 12 11:50:05 2013 +0000
> 
> ARM: use clockevents_config_and_register() where possible
> 
> The timer is wrongly configured and result in since crash
> so revert it on rm9200 timer
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> Hi Greg,
> 
> 	if possible apply it to v3.8 and v3.9 stable
> 
> 	I'll apply it for mainline

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

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

* [PATCH 1/1] ARM: at91: rm9200 fix time support
  2013-05-05 20:20 Jean-Christophe PLAGNIOL-VILLARD
  2013-05-05 21:26 ` Greg KH
@ 2013-05-15 10:08 ` Nicolas Ferre
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Ferre @ 2013-05-15 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/05/2013 22:20, Jean-Christophe PLAGNIOL-VILLARD :
> since commit 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488
> Author: Shawn Guo <shawn.guo@linaro.org>
> Date:   Sat Jan 12 11:50:05 2013 +0000
>
> ARM: use clockevents_config_and_register() where possible
>
> The timer is wrongly configured and result in since crash
> so revert it on rm9200 timer

What is strange is that this function is widely used now. So before 
reverting its use for rm9200, we may have to find why it is not working 
properly...

Best regards,

> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> Hi Greg,
>
> 	if possible apply it to v3.8 and v3.9 stable
>
> 	I'll apply it for mainline
>
> Best Regards,
> J.
>   arch/arm/mach-at91/at91rm9200_time.c |    7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
> index 2acdff4..180b302 100644
> --- a/arch/arm/mach-at91/at91rm9200_time.c
> +++ b/arch/arm/mach-at91/at91rm9200_time.c
> @@ -174,6 +174,7 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
>   static struct clock_event_device clkevt = {
>   	.name		= "at91_tick",
>   	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
> +	.shift		= 32,
>   	.rating		= 150,
>   	.set_next_event	= clkevt32k_next_event,
>   	.set_mode	= clkevt32k_mode,
> @@ -264,9 +265,11 @@ void __init at91rm9200_timer_init(void)
>   	at91_st_write(AT91_ST_RTMR, 1);
>
>   	/* Setup timer clockevent, with minimum of two ticks (important!!) */
> +	clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
> +	clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
> +	clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
>   	clkevt.cpumask = cpumask_of(0);
> -	clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
> -					2, AT91_ST_ALMV);
> +	clockevents_register_device(&clkevt);
>
>   	/* register clocksource */
>   	clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
>


-- 
Nicolas Ferre

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

* [PATCH 1/1] ARM: at91: rm9200 fix time support
@ 2013-05-15 10:12 Jean-Christophe PLAGNIOL-VILLARD
  2013-05-15 10:36 ` Nicolas Ferre
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-15 10:12 UTC (permalink / raw)
  To: linux-arm-kernel

since commit 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488
Author: Shawn Guo <shawn.guo@linaro.org>
Date:   Sat Jan 12 11:50:05 2013 +0000

ARM: use clockevents_config_and_register() where possible

The timer is wrongly configured and result in a nice crash
so revert it on rm9200 timer

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: stable <stable@vger.kernel.org> # 3.8+
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/mach-at91/at91rm9200_time.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 2acdff4..180b302 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -174,6 +174,7 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
 static struct clock_event_device clkevt = {
 	.name		= "at91_tick",
 	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+	.shift		= 32,
 	.rating		= 150,
 	.set_next_event	= clkevt32k_next_event,
 	.set_mode	= clkevt32k_mode,
@@ -264,9 +265,11 @@ void __init at91rm9200_timer_init(void)
 	at91_st_write(AT91_ST_RTMR, 1);
 
 	/* Setup timer clockevent, with minimum of two ticks (important!!) */
+	clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
+	clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
+	clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
 	clkevt.cpumask = cpumask_of(0);
-	clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
-					2, AT91_ST_ALMV);
+	clockevents_register_device(&clkevt);
 
 	/* register clocksource */
 	clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
-- 
1.7.10.4

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

* [PATCH 1/1] ARM: at91: rm9200 fix time support
  2013-05-15 10:12 Jean-Christophe PLAGNIOL-VILLARD
@ 2013-05-15 10:36 ` Nicolas Ferre
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Ferre @ 2013-05-15 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 15/05/2013 12:12, Jean-Christophe PLAGNIOL-VILLARD :
> since commit 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488
> Author: Shawn Guo <shawn.guo@linaro.org>
> Date:   Sat Jan 12 11:50:05 2013 +0000
>
> ARM: use clockevents_config_and_register() where possible
>
> The timer is wrongly configured and result in a nice crash
> so revert it on rm9200 timer
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: stable <stable@vger.kernel.org> # 3.8+
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Ok, even if I said that it would have been better to understand the root 
cause of this, it is also true that we have to move forward in the 
meantime...

So, yes, I take it for at91-3.10-fixes:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks,


> ---
>   arch/arm/mach-at91/at91rm9200_time.c |    7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
> index 2acdff4..180b302 100644
> --- a/arch/arm/mach-at91/at91rm9200_time.c
> +++ b/arch/arm/mach-at91/at91rm9200_time.c
> @@ -174,6 +174,7 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
>   static struct clock_event_device clkevt = {
>   	.name		= "at91_tick",
>   	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
> +	.shift		= 32,
>   	.rating		= 150,
>   	.set_next_event	= clkevt32k_next_event,
>   	.set_mode	= clkevt32k_mode,
> @@ -264,9 +265,11 @@ void __init at91rm9200_timer_init(void)
>   	at91_st_write(AT91_ST_RTMR, 1);
>
>   	/* Setup timer clockevent, with minimum of two ticks (important!!) */
> +	clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
> +	clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
> +	clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
>   	clkevt.cpumask = cpumask_of(0);
> -	clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
> -					2, AT91_ST_ALMV);
> +	clockevents_register_device(&clkevt);
>
>   	/* register clocksource */
>   	clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
>


-- 
Nicolas Ferre

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

end of thread, other threads:[~2013-05-15 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-05 20:13 [PATCH 1/1] ARM: at91: rm9200 fix time support Jean-Christophe PLAGNIOL-VILLARD
  -- strict thread matches above, loose matches on Subject: below --
2013-05-05 20:20 Jean-Christophe PLAGNIOL-VILLARD
2013-05-05 21:26 ` Greg KH
2013-05-15 10:08 ` Nicolas Ferre
2013-05-15 10:12 Jean-Christophe PLAGNIOL-VILLARD
2013-05-15 10:36 ` Nicolas Ferre

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