All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] clocksource:fix kernel panic due missing event_handler in cs5535
       [not found] <1464604292-11276-1-git-send-email-ulli.kroll@googlemail.com>
@ 2016-05-30 10:35 ` Thomas Gleixner
  2016-05-31  7:09   ` Hans Ulli Kroll
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Gleixner @ 2016-05-30 10:35 UTC (permalink / raw)
  To: Hans Ulli Kroll; +Cc: linux-kernel, Daniel Lezcano, stable

On Mon, 30 May 2016, Hans Ulli Kroll wrote:

> Missing event_handler in mfgpt_tick() caused a kernel panic.

So the real problem is that the interrupt in the device is enabled _BEFORE_
the clock event device is registered.
 
> diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c
> index 9a7e37c..6f186cf 100644
> --- a/drivers/clocksource/cs5535-clockevt.c
> +++ b/drivers/clocksource/cs5535-clockevt.c
> @@ -129,7 +129,9 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
>  		cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP,
>  				MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);
>  
> -	cs5535_clockevent.event_handler(&cs5535_clockevent);
> +	if (cs5535_clockevent.event_handler)
> +		cs5535_clockevent.event_handler(&cs5535_clockevent);
> +

So what about fixing the above problem instead of having a conditional in the
interrupt handler fast path?

Thanks,

	tglx

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

* Re: [PATCH] clocksource:fix kernel panic due missing event_handler in cs5535
  2016-05-30 10:35 ` [PATCH] clocksource:fix kernel panic due missing event_handler in cs5535 Thomas Gleixner
@ 2016-05-31  7:09   ` Hans Ulli Kroll
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Ulli Kroll @ 2016-05-31  7:09 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Hans Ulli Kroll, linux-kernel, Daniel Lezcano, stable

HI

On Mon, 30 May 2016, Thomas Gleixner wrote:

> On Mon, 30 May 2016, Hans Ulli Kroll wrote:
> 
> > Missing event_handler in mfgpt_tick() caused a kernel panic.
> 
> So the real problem is that the interrupt in the device is enabled _BEFORE_
> the clock event device is registered.
>  
> > diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c
> > index 9a7e37c..6f186cf 100644
> > --- a/drivers/clocksource/cs5535-clockevt.c
> > +++ b/drivers/clocksource/cs5535-clockevt.c
> > @@ -129,7 +129,9 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
> >  		cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP,
> >  				MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);
> >  
> > -	cs5535_clockevent.event_handler(&cs5535_clockevent);
> > +	if (cs5535_clockevent.event_handler)
> > +		cs5535_clockevent.event_handler(&cs5535_clockevent);
> > +
> 
> So what about fixing the above problem instead of having a conditional in the
> interrupt handler fast path?
> 

So there in an default handler for this in the clockevent framework.
OK, for this approach.
I'll send another patch.

Greetings from Cologne
Hans Ulli Kroll

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

end of thread, other threads:[~2016-05-31  7:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1464604292-11276-1-git-send-email-ulli.kroll@googlemail.com>
2016-05-30 10:35 ` [PATCH] clocksource:fix kernel panic due missing event_handler in cs5535 Thomas Gleixner
2016-05-31  7:09   ` Hans Ulli Kroll

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.