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: 2942461 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8B30BFF05 for ; Wed, 25 Sep 2013 14:05:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EB0E2042A for ; Wed, 25 Sep 2013 14:05:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9312203AE for ; Wed, 25 Sep 2013 14:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755729Ab3IYOFn (ORCPT ); Wed, 25 Sep 2013 10:05:43 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:45803 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755547Ab3IYOFm (ORCPT ); Wed, 25 Sep 2013 10:05:42 -0400 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-samsung-soc@vger.kernel.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 Cc: linux-arm-kernel@lists.infradead.org, Kukjin Kim , Olof Johansson , Daniel Lezcano , Thomas Gleixner , Russell King - ARM Linux , Stephen Boyd , Kyungmin Park , Lukasz Majewski 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 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii 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= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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);