From patchwork Mon Oct 8 02:17:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 1563441 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 C58613FD9C for ; Mon, 8 Oct 2012 02:19:42 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TL2ul-0002ZF-KX; Mon, 08 Oct 2012 02:17:51 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TL2uW-0002Vs-1H for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 02:17:36 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBJ00869Y92K8D0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 11:17:31 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-4f-507237bb7272 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id B7.CF.03860.BB732705; Mon, 08 Oct 2012 11:17:31 +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 <0MBJ00IX1YD3KJK0@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 11:17:31 +0900 (KST) From: Chanho Park To: kgene.kim@samsung.com, ben-linux@fluff.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v4 1/5] ARM: EXYNOS: Add set_irq_affinity function for combiner_irq Date: Mon, 08 Oct 2012 11:17:06 +0900 Message-id: <1349662630-11607-2-git-send-email-chanho61.park@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1349662630-11607-1-git-send-email-chanho61.park@samsung.com> References: <1349662630-11607-1-git-send-email-chanho61.park@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd3d5kUBBgsf8FhsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MVb1tzAVvxCoOtCxgaWD8KtTFyMkhIWAi8WDCA2YIW0ziwr31 bF2MXBxCAosYJf42XGOGcNYySeyeNgWsik1AV2LL81eMILaIQKXEwentLCBFzAKrGSU+7VrA ApIQFgiVuPX7J5jNIqAqsfXwa1YQm1fAU+LRtP1AzRxA6xQk5kyyAQlzCnhJ9Ny/DlYiBFTy cmcH0wRG3gWMDKsYRVMLkguKk9JzjfSKE3OLS/PS9ZLzczcxgn3+THoH46oGi0OMAhyMSjy8 H/WKAoRYE8uKK3MPMUpwMCuJ8DaYFwYI8aYkVlalFuXHF5XmpBYfYpTmYFES5232SAkQEkhP LEnNTk0tSC2CyTJxcEo1ME5+vOps+V3RwDr7nAJxiVlvatnWZiVzmHvkqM6OEDz5/PyDuRtc W1lnne3cHWAgsmNR00Ieno/aCxQ/+LhlpNxfoJc0a4cOp/GJUNeT2fIrOXd2CEQ80xNijnUL P3mi42cE/3uZST8Se7hmN4Us692UuWbeIz/l+ElbT/64d8Qz70R03bm/q5VYijMSDbWYi4oT AaZkvAT1AQAA X-Spam-Note: CRM114 invocation failed X-Spam-Score: -9.0 (---------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-9.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -2.1 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@samsung.com, 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. Reviewed-by: Thomas Abraham 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 715b690..709245e 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); } }