From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: Re: [PATCH 1/7] clocksource: mediatek: Don't run event_handler if it is NULL Date: Mon, 04 May 2015 10:14:56 +0200 Message-ID: <55472A80.9020904@linaro.org> References: <1430466210-22963-1-git-send-email-yingjoe.chen@mediatek.com> <1430466210-22963-2-git-send-email-yingjoe.chen@mediatek.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1430466210-22963-2-git-send-email-yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Yingjoe Chen , Mark Rutland , Matthias Brugger , Thomas Gleixner , Arnd Bergmann , Olof Johansson Cc: Rob Herring , Pawel Moll , Ian Campbell , Russell King , Jason Cooper , Catalin Marinas , Marc Carino , Lorenzo Pieralisi , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, Sascha Hauer List-Id: devicetree@vger.kernel.org On 05/01/2015 09:43 AM, Yingjoe Chen wrote: > Spurious timer interrupt is noticed in mtk timer and cause kernel > crash. In mtk_timer_interrupt(), only run event_handler if it is > not NULL. > > Signed-off-by: Yingjoe Chen > --- > drivers/clocksource/mtk_timer.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mt= k_timer.c > index 68ab423..85e0ab5 100644 > --- a/drivers/clocksource/mtk_timer.c > +++ b/drivers/clocksource/mtk_timer.c > @@ -143,7 +143,8 @@ static irqreturn_t mtk_timer_interrupt(int irq, v= oid *dev_id) > > /* Acknowledge timer0 irq */ > writel(GPT_IRQ_ACK(GPT_CLK_EVT), evt->gpt_base + GPT_IRQ_ACK_REG); > - evt->dev.event_handler(&evt->dev); > + if (evt->dev.event_handler) > + evt->dev.event_handler(&evt->dev); > > return IRQ_HANDLED; > } > This fix does not look good. Could you try by requesting the irq *after*=20 clockevents_config_and_register in the init sequence [1] ? Thanks -- Daniel [1]=20 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/= ?id=3D1096be084ac59927158ce80ff1d31c33eed0e565 --=20 Linaro.org =E2=94=82 Open source software fo= r ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html