Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1947526ima; Thu, 25 Oct 2018 07:25:21 -0700 (PDT) X-Google-Smtp-Source: AJdET5dxazEqh68Ofd3Ll0TP+i8XseJDjZaGdF9qnf6DwyN120ufeBMWtoPkDnwuRnYQfHPkkX9y X-Received: by 2002:a63:5816:: with SMTP id m22-v6mr1663189pgb.332.1540477521215; Thu, 25 Oct 2018 07:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477521; cv=none; d=google.com; s=arc-20160816; b=M5DWeCEU+GZTQDQrvcaliI+garFIV2m1e/3ILjKMNkHHpkEJdHyFH89vm3g0KV9Sq9 nPuuehmaIyXmJKqlIbU7Q/5QxlLTZqMbGzUemKZzH4zO5RUnC2fIsL80wsKWjvczZGQC v/K0bVEUwEpCy2kCRHGawZqRXe8PpP0VOakFtcDFjMqLwqEXTV9F15ifZXg8Z24oqAhK pvv2FMtxAxGoKrxI2VK1tM4kl+rzWxXEcjvE3vlWuzlnBUecmxVzgjvG2jPeIs9RC3Gx 1qzJRrDAqpkDCHVBxbpTxRzgtTyCFrfVvZPwbm3roefqFjMPDGEgkVqK2/m0aa30FEeb 1wfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=q5Z5GHiuDPZ8V3x/stra/sJnKeL/m52L6+iq1RhPbk4=; b=Gfg+IlcRSodC3p9IMP9BdBNsHazYbi/DSaqARvNJW1lhRojkF4aqY0Xz7kQxt5T5v8 eVLPySRSG+j6n8wBTA0Qnmzu9y5yuSWuOwTEuF89ylvOtFLJ6W+8TmFhgNIskP7wjUjq LA9cvu+/mWb82GF/Nt/W55MgOiiJCVjMVzMK6rzm7OtkggDed38VKllv7iK0MJzhTTxY qNyhlztA5gWTSigocbiLVc2F0abCEFZlGrC+ZXuC1OgDLWARVkkb6vOq10BSA7Mc6TkR 44xOktfD/Ep+YSd/NiSr6xDlw/1zRVerOVuGmOCvp7Kd+6KyfWQnZfsMvBilIHEtwfNL uwcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mj5ksQx7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 185-v6si8489808pff.270.2018.10.25.07.24.35; Thu, 25 Oct 2018 07:25:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mj5ksQx7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731239AbeJYWxu (ORCPT + 99 others); Thu, 25 Oct 2018 18:53:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:36510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729445AbeJYWxt (ORCPT ); Thu, 25 Oct 2018 18:53:49 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B38B42086D; Thu, 25 Oct 2018 14:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540477251; bh=cbSHfCGldFQfgA6G4YXr5JHdOoC7UICgr8ILQAwk9C8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mj5ksQx7R8mS/OUUGpqMTZSg7Lyw5sqYa0pUMRIBTPo3xnM0WFCqMAWD7slkjC4cl 5H7RwJ02CA2fkOm//zLO1Ud4LURpAL0n3vU2DaZfUgGponMeUh6CDzPfc9uj7Y+l75 nYu46Rb7oB+CAzmbGBvvH5IUixrAcmLlDBrsDdsk= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joonyoung Shim , linux-samsung-soc@vger.kernel.org, cw00.choi@samsung.com, daniel.lezcano@linaro.org, javier@osg.samsung.com, kgene@kernel.org, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Sasha Levin Subject: [PATCH AUTOSEL 3.18 77/98] clocksource/exynos_mct: Clear interrupt when cpu is shut down Date: Thu, 25 Oct 2018 10:18:32 -0400 Message-Id: <20181025141853.214051-77-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141853.214051-1-sashal@kernel.org> References: <20181025141853.214051-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joonyoung Shim [ Upstream commit bc7c36eedb0c7004aa06c2afc3c5385adada8fa3 ] When a CPU goes offline a potentially pending timer interrupt is not cleared. When the CPU comes online again then the pending interrupt is delivered before the per cpu clockevent device is initialized. As a consequence the tick interrupt handler dereferences a NULL pointer. [ 51.251378] Unable to handle kernel NULL pointer dereference at virtual address 00000040 [ 51.289348] task: ee942d00 task.stack: ee960000 [ 51.293861] PC is at tick_periodic+0x38/0xb0 [ 51.298102] LR is at tick_handle_periodic+0x1c/0x90 Clear the pending interrupt in the cpu dying path. Fixes: 56a94f13919c ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier") Reported-by: Seung-Woo Kim Signed-off-by: Joonyoung Shim Cc: linux-samsung-soc@vger.kernel.org Cc: cw00.choi@samsung.com Cc: daniel.lezcano@linaro.org Cc: stable@vger.kernel.org Cc: javier@osg.samsung.com Cc: kgene@kernel.org Cc: krzk@kernel.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1484628876-22065-1-git-send-email-jy0922.shim@samsung.com Signed-off-by: Thomas Gleixner Signed-off-by: Sasha Levin --- drivers/clocksource/exynos_mct.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index c844616028d2..714f9a767b17 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -487,6 +487,7 @@ static void exynos4_local_timer_stop(struct clock_event_device *evt) if (mct_int_type == MCT_INT_SPI) { if (evt->irq != -1) disable_irq_nosync(evt->irq); + exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET); } else { disable_percpu_irq(mct_irqs[MCT_L0_IRQ]); } -- 2.17.1