From patchwork Thu Jul 26 00:35:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 1240061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 25670DFFCD for ; Thu, 26 Jul 2012 00:42:51 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SuC4U-0000aq-Rv; Thu, 26 Jul 2012 00:36:54 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SuC3x-0000aM-1i for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2012 00:36:25 +0000 Received: from epcpsbgm1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7Q00E3QSCE7030@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2012 09:36:16 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-6c-501090ffce34 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A6.7A.19326.FF090105; Thu, 26 Jul 2012 09:36:15 +0900 (KST) Received: from localhost.localdomain ([10.90.51.45]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7Q00EOXSAG9140@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2012 09:36:15 +0900 (KST) From: Chanho Park To: kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org, ben-linux@fluff.org Subject: [PATCH 2/2] ARM: EXYNOS: Add set_irq_affinity function for combiner_irq Date: Thu, 26 Jul 2012 09:35:02 +0900 Message-id: <1343262902-19073-3-git-send-email-chanho61.park@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1343262902-19073-1-git-send-email-chanho61.park@samsung.com> References: <1343262902-19073-1-git-send-email-chanho61.park@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jQd3/EwQCDN42W1psenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MDXf72Qr2iFWsnfWJtYHxpFAXIyeHhICJxJeV7UwQtpjEhXvr 2boYuTiEBKYzSrw72MsE4axlkjj5ZhUzSBWbgK7EluevGEFsEYFgiSW3WllBipgFGhglll25 xwqSEBYIkJh+bzYLiM0ioCrROmkeWAOvgKfEsp0gDRxA6xQk5kyyAQlzCnhJ3Hr6FKxECKik b/YJ5gmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBPv8mdQOxpUNFocYBTgYlXh4 PcMFAoRYE8uKK3MPMUpwMCuJ8LqlA4V4UxIrq1KL8uOLSnNSiw8xSnOwKInzGnt/9RcSSE8s Sc1OTS1ILYLJMnFwSjUwLqtPPfPBMyq3u2T6V/fonS9m3QkRO3zH/Xz1P68T8ooRmv4ukxuN FAIn/fG8dWQv98zOG40rr3G0brvQFqNxZ8bljOdsCr+j1zJvUw6s7o5+wc0y0UZ/ntLGfV+2 9Ek/21GsNW/uwjfqSbuZEhyMosMjdJWOPpDQMPI2Ft95OnKrlnjGrbm5SizFGYmGWsxFxYkA DHPA0/UBAAA= X-TM-AS-MML: No X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Chanho Park , Kyungmin Park , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds set_irq_affinity function for combiner_irq. We need this function to enable a arm-pmu because the irq of exynos's pmu is declared combiner_irq. Signed-off-by: Chanho Park Signed-off-by: Kyungmin Park --- arch/arm/mach-exynos/common.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 4eb39cd..f194bbc 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -405,6 +405,7 @@ struct combiner_chip_data { unsigned int irq_offset; unsigned int irq_mask; void __iomem *base; + unsigned int parent_irq; }; static struct irq_domain *combiner_irq_domain; @@ -461,10 +462,28 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) chained_irq_exit(chip, desc); } +#ifdef CONFIG_SMP +static int combiner_set_affinity(struct irq_data *d, + const struct cpumask *mask_val, bool force) +{ + struct combiner_chip_data *chip_data = irq_data_get_irq_chip_data(d); + struct irq_chip *chip = irq_get_chip(chip_data->parent_irq); + struct irq_data *data = irq_get_irq_data(chip_data->parent_irq); + + if (chip && chip->irq_set_affinity) + return chip->irq_set_affinity(data, mask_val, force); + else + return -EINVAL; +} +#endif + static struct irq_chip combiner_chip = { - .name = "COMBINER", - .irq_mask = combiner_mask_irq, - .irq_unmask = combiner_unmask_irq, + .name = "COMBINER", + .irq_mask = combiner_mask_irq, + .irq_unmask = combiner_unmask_irq, +#ifdef CONFIG_SMP + .irq_set_affinity = combiner_set_affinity, +#endif }; static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq) @@ -484,12 +503,13 @@ static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int i } static void __init combiner_init_one(unsigned int combiner_nr, - void __iomem *base) + void __iomem *base, unsigned int irq) { combiner_data[combiner_nr].base = base; combiner_data[combiner_nr].irq_offset = irq_find_mapping( combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER); combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3); + combiner_data[combiner_nr].parent_irq = irq; /* Disable all interrupts */ __raw_writel(combiner_data[combiner_nr].irq_mask, @@ -573,12 +593,12 @@ static void __init combiner_init(void __iomem *combiner_base, } for (i = 0; i < max_nr; i++) { - combiner_init_one(i, combiner_base + (i >> 2) * 0x10); irq = IRQ_SPI(i); #ifdef CONFIG_OF if (np) irq = irq_of_parse_and_map(np, i); #endif + combiner_init_one(i, combiner_base + (i >> 2) * 0x10, irq); combiner_cascade_irq(i, irq); } }