From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from www.linutronix.de ([62.245.132.108]:53022 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754249AbcE3Khp (ORCPT ); Mon, 30 May 2016 06:37:45 -0400 Date: Mon, 30 May 2016 12:35:52 +0200 (CEST) From: Thomas Gleixner To: Hans Ulli Kroll cc: linux-kernel@vger.kernel.org, Daniel Lezcano , stable@vger.kernel.org Subject: Re: [PATCH] clocksource:fix kernel panic due missing event_handler in cs5535 In-Reply-To: <1464604292-11276-1-git-send-email-ulli.kroll@googlemail.com> Message-ID: References: <1464604292-11276-1-git-send-email-ulli.kroll@googlemail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: stable-owner@vger.kernel.org List-ID: 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