linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: timer-sp: ensure interrupt is cleared at sp804_clockevents_init
@ 2014-09-17  0:42 Chanho Min
  2014-09-17  1:09 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Chanho Min @ 2014-09-17  0:42 UTC (permalink / raw)
  To: linux-arm-kernel

When sp804 is registerd as clock event device, it may not be added to
tick device if the higher rated device is already registerd. In this case,
for uncertan reason, inetrrupt is occured without event_handler it cause
kernel panic. So Interrupt should be cleared before clockevent is registered.

Signed-off-by: Chanho Min <chanho.min@lge.com>
---
 arch/arm/common/timer-sp.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index fd6bff0..b658873 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -205,6 +205,8 @@ void __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struc
 
 	writel(0, base + TIMER_CTRL);
 
+	/* Ensure interrupt is cleared */
+	writel(1, clkevt_base + TIMER_INTCLR);
 	setup_irq(irq, &sp804_timer_irq);
 	clockevents_config_and_register(evt, rate, 0xf, 0xffffffff);
 }
-- 
1.7.9.5

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

* [PATCH] ARM: timer-sp: ensure interrupt is cleared at sp804_clockevents_init
  2014-09-17  0:42 [PATCH] ARM: timer-sp: ensure interrupt is cleared at sp804_clockevents_init Chanho Min
@ 2014-09-17  1:09 ` Stephen Boyd
  2014-09-17  2:58   ` Chanho Min
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2014-09-17  1:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/17, Chanho Min wrote:
> When sp804 is registerd as clock event device, it may not be added to

s/registerd/registered/

> tick device if the higher rated device is already registerd. In this case,

s/registerd/registered/

> for uncertan reason, inetrrupt is occured without event_handler it cause

s/inetrrupt/interrupt/

> kernel panic. So Interrupt should be cleared before clockevent is registered.
> 
> Signed-off-by: Chanho Min <chanho.min@lge.com>
> ---
>  arch/arm/common/timer-sp.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
> index fd6bff0..b658873 100644
> --- a/arch/arm/common/timer-sp.c
> +++ b/arch/arm/common/timer-sp.c
> @@ -205,6 +205,8 @@ void __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struc
>  
>  	writel(0, base + TIMER_CTRL);
>  
> +	/* Ensure interrupt is cleared */
> +	writel(1, clkevt_base + TIMER_INTCLR);
>  	setup_irq(irq, &sp804_timer_irq);
>  	clockevents_config_and_register(evt, rate, 0xf, 0xffffffff);

Or just flip the order of clockevents_config_and_register() and
setup_irq()? We've done this in other clockevents drivers.

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

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

* [PATCH] ARM: timer-sp: ensure interrupt is cleared at sp804_clockevents_init
  2014-09-17  1:09 ` Stephen Boyd
@ 2014-09-17  2:58   ` Chanho Min
  0 siblings, 0 replies; 3+ messages in thread
From: Chanho Min @ 2014-09-17  2:58 UTC (permalink / raw)
  To: linux-arm-kernel

> > +	/* Ensure interrupt is cleared */
> > +	writel(1, clkevt_base + TIMER_INTCLR);
> >  	setup_irq(irq, &sp804_timer_irq);
> >  	clockevents_config_and_register(evt, rate, 0xf, 0xffffffff);
> 
> Or just flip the order of clockevents_config_and_register() and
> setup_irq()? We've done this in other clockevents drivers.
It won't fix this issue. clockevents_config_and_register will do nothing
if the higher rated device is registered. if pending interrupt is existed,
interrupt will be triggered as soon as setup_irq is done.

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

end of thread, other threads:[~2014-09-17  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-17  0:42 [PATCH] ARM: timer-sp: ensure interrupt is cleared at sp804_clockevents_init Chanho Min
2014-09-17  1:09 ` Stephen Boyd
2014-09-17  2:58   ` Chanho Min

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