From patchwork Fri Jul 27 08:08:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 1247341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C95753FDD9 for ; Fri, 27 Jul 2012 08:18:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SufdV-0005qA-QW; Fri, 27 Jul 2012 08:11:02 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sufbj-0005Z3-MJ for linux-arm-kernel@lists.infradead.org; Fri, 27 Jul 2012 08:09:12 +0000 Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7T00BBR7YBY0U0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 27 Jul 2012 17:08:37 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-47-50124c84ab11 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BC.A2.19326.48C42105; Fri, 27 Jul 2012 17:08:36 +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 <0M7T007T07Y88OC0@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 27 Jul 2012 17:08:36 +0900 (KST) From: Chanho Park To: kgene.kim@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCHv2 1/3] ARM: EXYNOS: Add set_irq_affinity function for combiner_irq Date: Fri, 27 Jul 2012 17:08:27 +0900 Message-id: <1343376509-5881-2-git-send-email-chanho61.park@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1343376509-5881-1-git-send-email-chanho61.park@samsung.com> References: <1343376509-5881-1-git-send-email-chanho61.park@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPJMWRmVeSWpSXmKPExsVy+t9jQd0WH6EAg9/TLC02Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfGhrv9bAV7xCrWzvrE2sB4UqiLkZNDQsBE4uD/yWwQtpjEhXvr gWwuDiGB6YwSZ3e9AksICaxlklh8mR/EZhPQldjy/BUjiC0ikCJx5UY/mM0ssIBRYv+XkC5G Dg5hgRCJJVuTQMIsAqoSz/6dYAGxeQU8JDr2PWEGKZEQUJCYM8kGJMwp4ClxaP8LqE0eEpOP T2GewMi7gJFhFaNoakFyQXFSeq6hXnFibnFpXrpecn7uJkawt59J7WBc2WBxiFGAg1GJh3ci r1CAEGtiWXFl7iFGCQ5mJRHer7ZAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rzG3l/9hQTSE0tS s1NTC1KLYLJMHJxSDYxLf36/c6Rr1VmlFek3p1e+nfli8kTOS/3mUgqOTulNvQUr3yyUm1Ie VH5BVKM8KSNerWNa54/rK/Ssmk9eUUr3mMGqu+rEpB1LsmsSE/+n673Sm7+w1cG6wFY0/+Lx UMaDKv76OvYlajNdPzsvSmzVNkyOdXA9GjJFPVUp5oOB6daJKw/xRCmxFGckGmoxFxUnAgCS 6FRR8gEAAA== X-TM-AS-MML: No X-Spam-Note: CRM114 invocation failed X-Spam-Note: SpamAssassin invocation failed Cc: sachin.kamat@linaro.org, will.deacon@arm.com, Chanho Park , linux@arm.linux.org.uk, Kyungmin Park 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); } }