From patchwork Tue Aug 8 09:04:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 9887271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70B8B601EB for ; Tue, 8 Aug 2017 09:12:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61E1F26E75 for ; Tue, 8 Aug 2017 09:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55F67283DA; Tue, 8 Aug 2017 09:12:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D659426E75 for ; Tue, 8 Aug 2017 09:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: Message-id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:List-Owner; bh=RpPhFvQ6XlyjJzv8HUyWYGUJb6XyhNX32lI4n0Pq9To=; b=tJ gUB0/ayZKWffwB7DrK3kE3JSAKdxEhQYgZtd684/PG77sdKwKdLU8gA81ESYtNS8v5BOGnVUi3/lM hvL49o2rIBySOXmWUSQifOEkZ/81CG0uTXwbp7APLBewBl0qOsbGbHgOuEpyakXAc83ozE4nNbmML q6rK8z2OZMVgsiinX9XbpPTQKj1L46rSn5sPFrMwflY6PJr95c7+ZPmnqJdxlAZ0G2IeQflnhbj86 KR9hfVdnj8098UItNeX35pEYxARDEgilQ0uvngHh9HcQOyOSSziJsn0C/QKC0eETmgyGx3ufSkMlP 9iUaSOFRjPm4wxUTL/EFrlpIBBFm5Kmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1df0Yh-0003XI-BL; Tue, 08 Aug 2017 09:12:15 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1df0Yd-0003QE-LL for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2017 09:12:14 +0000 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20170808091131epoutp03709599c71cc48b08bf39b9e074588f5a~Y0_0c-0Mz0585905859epoutp03k; Tue, 8 Aug 2017 09:11:31 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.42.56]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170808091130epcas1p1ed51eadc5b7663b23b66c446e538820f~Y0_zqWHyc2375323753epcas1p1U; Tue, 8 Aug 2017 09:11:30 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 02.71.20296.24089895; Tue, 8 Aug 2017 18:11:30 +0900 (KST) Received: from epsmgms2p1.samsung.com (unknown [182.195.42.79]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170808091129epcas1p48d0523675178cb841d97e64d5baab75f~Y0_y4CXEc0792507925epcas1p44; Tue, 8 Aug 2017 09:11:29 +0000 (GMT) X-AuditID: b6c32a38-f799e6d000004f48-1b-5989804252bc Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 0C.58.06213.14089895; Tue, 8 Aug 2017 18:11:29 +0900 (KST) Received: from exypnos.sisodomain.com ([107.108.73.28]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OUD00ELG06YQL00@mmp1.samsung.com>; Tue, 08 Aug 2017 18:11:29 +0900 (KST) From: Alim Akhtar To: tglx@linutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH RFC] irqchip: gic-v3: Support forced cpu irq affinity setting Date: Tue, 08 Aug 2017 14:34:53 +0530 Message-id: <1502183093-30327-1-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKIsWRmVeSWpSXmKPExsWy7bCmga5TQ2ekwd9OHot3Dw+zWyy9VW2x fOUuFotDm7eyWzQuucxisenxNVaLy7vmsFn8vfOPzeLIw93sFps3TWV24PJYM28No8fOWXfZ PRoOnGfxeHfuHLvH5iX1Hn1bVjF6fN4kF8AexWWTkpqTWZZapG+XwJVxZeEL1oIZ3BV/np9m bWCcw9nFyMkhIWAicW36PyYIW0ziwr31bF2MXBxCAjsYJU4cf80M4XxmlNj2YAILTMfJ+1MR qo4vX8sK4fxklHi5dRsbSBWbgLbE3elbwOaKAHXcOnOUGcRmFrjIKPH+XgqILSzgL9G9+DFY PYuAqsSLq1fBbF4Bd4k7X+5DbZOTuHmuE+wMCYHfbBJHHkwCGsoB5MhKbDrADGG6SJy4LgZR Lizx6vgWdghbSqLx5UOo18ol2q/+gxrTwShxatI5qPn2EgeuzGGBuI1P4t3XHlaImbwSHW1C ECUeEt0nnkLNdJSYcuEI2EwhgViJdR92sExglF7AyLCKUSy1oDg3PbXYsMBErzgxt7g0L10v O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q+T02bZ96YoLFrkaq2x03G/Ycqy3sez8q6kse4zt+ez3zrt5ev3k gun6N0RXvCpZuF2JpTgj0VCLuag4EQA89Y+efgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170808091129epcas1p48d0523675178cb841d97e64d5baab75f X-Msg-Generator: CA X-Sender-IP: 182.195.42.79 X-Local-Sender: =?UTF-8?B?7JWM66a8G1NTSVItRkRTIFNXG+yCvOyEseyghOyekBsuL1Nl?= =?UTF-8?B?bmlvciBDaGllZiBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QUxJTSBBS0hUQVIbU1NJUi1GRFMgU1cbU2Ftc3VuZyBFbGVj?= =?UTF-8?B?dHJvbmljcxsuL1NlbmlvciBDaGllZiBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1NXQUhRG0MxMElEMDdJRDAxMDk5Nw==?= CMS-TYPE: 101P X-CMS-RootMailID: 20170808091129epcas1p48d0523675178cb841d97e64d5baab75f X-RootMTR: 20170808091129epcas1p48d0523675178cb841d97e64d5baab75f References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170808_021212_052730_CEAA8AFC X-CRM114-Status: GOOD ( 10.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: abhinav.k@samsung.com, shaik.ameer@samsung.com, jason@lakedaemon.net, marc.zyngier@arm.com, aswani.reddy@samsung.com, arjun.kv@samsung.com, alim.akhtar@gmail.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Skip check for online cpu mask when setting irq affinity of per cpu timer during early startup of not yet online cpu. Signed-off-by: Shaik Ameer Basha Signed-off-by: Aswani Reddy Signed-off-by: Alim Akhtar --- drivers/irqchip/irq-gic-v3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Currently when non boot CPUs comes up and if setting of IRQ affinity gets called before cpu online status gets updated, gic_mpidr_to_affinity() returns undesirable cpu number. Using __force__ flag ignore cpu_online_mask and setup the intended cpu affinity for the irq. The same approch is used in gicv2 (commit: ffde1de64012c: irqchip: Gic: Support forced affinity setting) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index dbffb7a..c238c64 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -640,11 +640,16 @@ static void gic_smp_init(void) static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, bool force) { - unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); + unsigned int cpu; void __iomem *reg; int enabled; u64 val; + if (!force) + cpu = cpumask_any_and(mask_val, cpu_online_mask); + else + cpu = cpumask_first(mask_val); + if (cpu >= nr_cpu_ids) return -EINVAL;