Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbbEDIe1 (ORCPT ); Mon, 4 May 2015 04:34:27 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:33345 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbbEDIeG (ORCPT ); Mon, 4 May 2015 04:34:06 -0400 MIME-Version: 1.0 In-Reply-To: <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> <55472A80.9020904@linaro.org> Date: Mon, 4 May 2015 10:34:04 +0200 Message-ID: Subject: Re: [PATCH 1/7] clocksource: mediatek: Don't run event_handler if it is NULL From: Matthias Brugger To: Daniel Lezcano Cc: Yingjoe Chen , Mark Rutland , Thomas Gleixner , Arnd Bergmann , Olof Johansson , Rob Herring , Pawel Moll , Ian Campbell , Russell King , Jason Cooper , Catalin Marinas , Marc Carino , Lorenzo Pieralisi , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-mediatek@lists.infradead.org, srv_heupstream , Sascha Hauer Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1677 Lines: 50 2015-05-04 10:14 GMT+02:00 Daniel Lezcano : > 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/mtk_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, void >> *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* clockevents_config_and_register > in the init sequence [1] ? > >From my understanding [1] should already fix this. [1] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/clocksource/mtk_timer.c?id=d4a19eb3b15a4ba98f627182f48d5bc0cffae670 Regards, Matthias -- motzblog.wordpress.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/