From patchwork Wed Sep 25 14:05:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2942471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 229B79F289 for ; Wed, 25 Sep 2013 14:06:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE6DD20328 for ; Wed, 25 Sep 2013 14:06:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AEEE2024A for ; Wed, 25 Sep 2013 14:06:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VOpjI-00049j-DN; Wed, 25 Sep 2013 14:06:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VOpjG-0001kY-0l; Wed, 25 Sep 2013 14:06:10 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VOpjC-0001jp-FC for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2013 14:06:08 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MTO00KCKPRYYK20@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2013 15:05:40 +0100 (BST) X-AuditID: cbfec7f4-b7f0a6d000007b1b-6b-5242edb4ef6b Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id CB.48.31515.4BDE2425; Wed, 25 Sep 2013 15:05:40 +0100 (BST) Received: from amdc1227.localnet ([106.116.147.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MTO00133PTG2460@eusync3.samsung.com>; Wed, 25 Sep 2013 15:05:40 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH RESEND CRITICAL] clocksource: exynos_mct: Set IRQ affinity when the CPU goes online Date: Wed, 25 Sep 2013 16:05:28 +0200 Message-id: <30004270.5bGcANHqs4@amdc1227> Organization: Samsung Poland R&D Center User-Agent: KMail/4.11 (Linux/3.10.10-gentoo; KDE/4.11.0; x86_64; ; ) In-reply-to: <1377534836-21682-1-git-send-email-t.figa@samsung.com> References: <1377534836-21682-1-git-send-email-t.figa@samsung.com> MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsVy+t/xq7pb3joFGfzp1LSY91nWonfBVTaL s01v2C3ePNzMaLHp8TVWixnn9zFZ3L7Ma3Hq+mc2ix9nulksNm+ayuzA5dHS3MPmcbmvl8nj zrU9bB7vzp1j99i8pN7jyokmVo++LasYPT5vkgvgiOKySUnNySxLLdK3S+DK2DT1CUvBepGK nq+vmRoYLwt0MXJwSAiYSHxbHdDFyAlkiklcuLeerYuRi0NIYCmjxOWWt0wgCSGBLiaJf3eE QWw2ATWJzw2P2EBsEQFVic9tC9hBGpgFfjBJ/PizgRUkISyQKvH9zkSwIhagohPnV7OBLOMV 0JK4/S4YJMwvoC7xbttTsPmiAq4SnxZuZAcp4RRwlnj5NAVirZPE0YZ+sIm8AoISPybfYwGx mQXkJfbtn8oKYWtJrN95nGkCo+AsJGWzkJTNQlK2gJF5FaNoamlyQXFSeq6hXnFibnFpXrpe cn7uJkZIvHzZwbj4mNUhRgEORiUeXoGjjkFCrIllxZW5hxglOJiVRHjrXjgFCfGmJFZWpRbl xxeV5qQWH2Jk4uCUamDsmTrt93vzsxYTLX/wppcs7z58WOfAjAWn54h+mvgrzz81f7OY+/R9 1xyvpnS2G34+vFfgk8D8l5qKXJ8KrKf9yl+uFPhwSd7q9h+/qlsD1s02O313onGa53ynGy5J FSL8rNs2L3zev0UtqmnGu+a/xhscTKNsmd/yvG43FF++Lql25cn7c8M7lViKMxINtZiLihMB KujzS3UCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130925_100606_609859_382D9C18 X-CRM114-Status: GOOD ( 13.82 ) X-Spam-Score: -8.9 (--------) Cc: Lukasz Majewski , Kukjin Kim , Russell King - ARM Linux , Daniel Lezcano , Stephen Boyd , Kyungmin Park , Olof Johansson , Thomas Gleixner , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-6.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Some variants of Exynos MCT, namely exynos4210-mct at the moment, use normal, shared interrupts for local timers. This means that each interrupt must have correct affinity set to fire only on CPU corresponding to given local timer. However after recent conversion of clocksource drivers to not use the local timer API for local timer initialization any more, the point of time when local timers get initialized changed and irq_set_affinity() fails because the CPU is not marked as online yet. This patch fixes this by moving the call to irq_set_affinity() to CPU_ONLINE notification, so the affinity is being set when the CPU goes online. This fixes a problem with Exynos4210 failing to boot, present since commit ee98d27df6 ARM: EXYNOS4: Divorce mct from local timer API due to failing irq_set_affinity(). Signed-off-by: Tomasz Figa --- drivers/clocksource/exynos_mct.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) Resending again, since my mail client previously freaked out and reset message format to HTML... diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 5b34768..62b0de6 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -428,7 +428,6 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt) evt->irq); return -EIO; } - irq_set_affinity(evt->irq, cpumask_of(cpu)); } else { enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0); } @@ -449,6 +448,7 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { struct mct_clock_event_device *mevt; + unsigned int cpu; /* * Grab cpu pointer in each case to avoid spurious @@ -459,6 +459,12 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self, mevt = this_cpu_ptr(&percpu_mct_tick); exynos4_local_timer_setup(&mevt->evt); break; + case CPU_ONLINE: + cpu = (unsigned long)hcpu; + if (mct_int_type == MCT_INT_SPI) + irq_set_affinity(mct_irqs[MCT_L0_IRQ + cpu], + cpumask_of(cpu)); + break; case CPU_DYING: mevt = this_cpu_ptr(&percpu_mct_tick); exynos4_local_timer_stop(&mevt->evt); @@ -500,6 +506,8 @@ static void __init exynos4_timer_resources(struct device_node *np, void __iomem &percpu_mct_tick); WARN(err, "MCT: can't request IRQ %d (%d)\n", mct_irqs[MCT_L0_IRQ], err); + } else { + irq_set_affinity(mct_irqs[MCT_L0_IRQ], cpumask_of(0)); } err = register_cpu_notifier(&exynos4_mct_cpu_nb);