From patchwork Wed Aug 29 01:14:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 1383391 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 4D7D23FC85 for ; Wed, 29 Aug 2012 01:22:55 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T6Wsh-0001BJ-0k; Wed, 29 Aug 2012 01:15:43 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T6WsN-0001AD-O6 for linux-arm-kernel@lists.infradead.org; Wed, 29 Aug 2012 01:15:25 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9H00MHFSPQEE30@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 29 Aug 2012 10:15:13 +0900 (KST) X-AuditID: cbfee61a-b7fc66d0000043b7-51-503d6d213e3d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CE.EC.17335.12D6D305; Wed, 29 Aug 2012 10:15:13 +0900 (KST) Received: from localhost.localdomain ([10.90.51.45]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9H00IO5ST8BV20@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 29 Aug 2012 10:15:13 +0900 (KST) From: Chanho Park To: kgene.kim@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 1/4] ARM: EXYNOS: Add set_irq_affinity function for combiner_irq Date: Wed, 29 Aug 2012 10:14:54 +0900 Message-id: <1346202897-27306-2-git-send-email-chanho61.park@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1346202897-27306-1-git-send-email-chanho61.park@samsung.com> References: <1346202897-27306-1-git-send-email-chanho61.park@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAJMWRmVeSWpSXmKPExsVy+t9jAV3FXNsAg7ZDJhabHl9jdWD02Lyk PoAxissmJTUnsyy1SN8ugStjy4Fm5oLNYhX7jvaxNDAeFOpi5OSQEDCRWLfsHRuELSZx4d56 MFtIYBGjxKfpaV2MXED2WiaJH7sWMIEk2AR0JbY8f8UIYosIpEhcudHPCFLELLCbUeL950lg CWGBUIlNzbdYQGwWAVWJ769OgTXzCnhKbDrxirWLkQNom4LEnEk2ICangJfE7R22EHs9JRb+ esE+gZF3ASPDKkbR1ILkguKk9FxDveLE3OLSvHS95PzcTYxgfz+T2sG4ssHiEKMAB6MSD+8F btsAIdbEsuLK3EOMEhzMSiK8T02BQrwpiZVVqUX58UWlOanFhxilOViUxHn5+wwDhATSE0tS s1NTC1KLYLJMHJxSDYymG2I2pP88ZDJX8KwOf/HLY+1nN61NKitizBfe9DOjr7nl8+GI1pz/ qvysbaqlPN675j3/Vzbl021tV9e8GV+Wr4t3uf1jlcPDT1Kpmx8GxRrk7u+8KLnseYXMJOEl /B+uH/7tJWY8I7WpMULEg2OaeB7X9coKL+2dj5+X7TWP4Ne98Vur5aQSS3FGoqEWc1FxIgDM X+Od8wEAAA== X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.1 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.2 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: linux@arm.linux.org.uk, sachin.kamat@linaro.org, will.deacon@arm.com, Kyungmin Park , thomas.abraham@linaro.org, Chanho 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 pmu of exynos has combined type irqs. Signed-off-by: Chanho Park Signed-off-by: Kyungmin Park Reviewed-by: Thomas Abraham --- 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); } }