From patchwork Fri May 1 07:43:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingjoe Chen X-Patchwork-Id: 6308871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4239CBEEE1 for ; Fri, 1 May 2015 07:47:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66B5D2044C for ; Fri, 1 May 2015 07:47:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A70D4203F1 for ; Fri, 1 May 2015 07:47:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yo5cb-00006B-4V; Fri, 01 May 2015 07:44:29 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yo5cV-0008R2-Tz; Fri, 01 May 2015 07:44:24 +0000 X-Listener-Flag: 11101 Received: from mtkhts07.mediatek.inc [(172.21.101.69)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 169330136; Fri, 01 May 2015 15:43:59 +0800 Received: from mtksdtcf02.mediatek.inc (10.21.12.142) by mtkhts07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.181.6; Fri, 1 May 2015 15:43:57 +0800 From: Yingjoe Chen To: Mark Rutland , Matthias Brugger , Thomas Gleixner , Arnd Bergmann , Olof Johansson Subject: [PATCH 1/7] clocksource: mediatek: Don't run event_handler if it is NULL Date: Fri, 1 May 2015 15:43:24 +0800 Message-ID: <1430466210-22963-2-git-send-email-yingjoe.chen@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1430466210-22963-1-git-send-email-yingjoe.chen@mediatek.com> References: <1430466210-22963-1-git-send-email-yingjoe.chen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150501_004424_236179_1741C858 X-CRM114-Status: UNSURE ( 6.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.3 (+) Cc: devicetree@vger.kernel.org, Lorenzo Pieralisi , Russell King , Jason Cooper , Pawel Moll , Ian Campbell , Catalin Marinas , Daniel Lezcano , linux-kernel@vger.kernel.org, Marc Carino , Rob Herring , linux-mediatek@lists.infradead.org, Sascha Hauer , Yingjoe Chen , srv_heupstream@mediatek.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }