clocksource:fix kernel panic due missing event_handler in cs5535
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Hans Ulli Kroll
Missing
event_handlerinmfgpt_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.
drivers/clocksource/cs5535-clockevt.c static irqreturn_t mfgpt_tick(int irq, void *dev_id) · line 134
Quoted 12 lines
drivers/clocksource/cs5535-clockevt.c +3
-1@@ -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
HI
Quoted 15 lines · Thomas Gleixner
Quoted 1 line · Hans Ulli Kroll
Missing
event_handlerinmfgpt_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.
Quoted 8 lines
drivers/clocksource/cs5535-clockevt.c +0
-0@@ -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 );
Quoted 8 lines
drivers/clocksource/cs5535-clockevt.c static irqreturn_t mfgpt_tick(int irq, void *dev_id) · line 134
Quoted 4 lines
drivers/clocksource/cs5535-clockevt.c +3
-1- 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