From patchwork Sun Dec 27 13:23:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noam Camus X-Patchwork-Id: 561160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2ED98140CE3 for ; Mon, 28 Dec 2015 00:29:36 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDBOA-00012B-NS; Sun, 27 Dec 2015 13:29:34 +0000 Received: from mail-am1on0056.outbound.protection.outlook.com ([157.56.112.56] helo=emea01-am1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDBO7-00010r-Sv for linux-snps-arc@lists.infradead.org; Sun, 27 Dec 2015 13:29:32 +0000 Received: from AMSPR02CA0044.eurprd02.prod.outlook.com (10.242.225.172) by DB3PR02MB0331.eurprd02.prod.outlook.com (10.160.45.13) with Microsoft SMTP Server (TLS) id 15.1.361.13; Sun, 27 Dec 2015 13:29:09 +0000 Received: from DB3FFO11FD054.protection.gbl (2a01:111:f400:7e04::113) by AMSPR02CA0044.outlook.office365.com (2a01:111:e400:8028::44) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Sun, 27 Dec 2015 13:29:09 +0000 Authentication-Results: spf=fail (sender IP is 212.179.42.66) smtp.mailfrom=ezchip.com; linaro.org; dkim=none (message not signed) header.d=none; linaro.org; dmarc=none action=none header.from=ezchip.com; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 212.179.42.66 as permitted sender) receiver=protection.outlook.com; client-ip=212.179.42.66; helo=ezex10.ezchip.com; Received: from ezex10.ezchip.com (212.179.42.66) by DB3FFO11FD054.mail.protection.outlook.com (10.47.217.126) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sun, 27 Dec 2015 13:29:08 +0000 Received: from localhost.localdomain (10.1.3.132) by ezex10.ezchip.com (10.1.1.4) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sun, 27 Dec 2015 15:28:45 +0200 From: Noam Camus To: Subject: [PATCH v5 10/20] ARC: IRQ: do not use hwirq directly at arch_do_IRQ() Date: Sun, 27 Dec 2015 15:23:29 +0200 Message-ID: <1451222619-3610-11-git-send-email-noamc@ezchip.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1451222619-3610-1-git-send-email-noamc@ezchip.com> References: <1451222619-3610-1-git-send-email-noamc@ezchip.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.000.1202-22026.007 X-TM-AS-Result: No--11.028500-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD054; 1:4S+aCXt56r617ccH3pkplg3yBpMNddR/1L/8QlF5WQTDX/jVzg0eMeFCESj1r34CHXexm30CHBsUwt8W+XAgy/aUSnRe4PegPtjr7GT2mRB6sxNedkTjcODuqoQ7SkgSP2KLFVH8YqFMukIGpWRWSq+eFFpw0cJWgfhiT5v3R4bEh5Jo16Lk1+n2rctg4iY0E7cuVwa8ns6IqSjacokQOtjnTzbSf0bN6UDSUTNo8bprlqsFNeI6KLlWRrtxkfTYJLhBPPXrG8b9K7N7UkrlBwRjjRB/Ycs4p8k0/9vNaGcLcprVTXXdf+6F+5fgNFggNLJltFyIu7fyQFxlleHSOmVN26hvgS2forYv4I4yQNSEyB4CG8723LbQ03sT4izpokJduw+usJq6o/CVrUo0papQCR5A6t7hDYJ7odvy7hU= X-Forefront-Antispam-Report: CIP:212.179.42.66; CTRY:IL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(49486002)(87936001)(586003)(104016004)(575784001)(86362001)(50226001)(189998001)(5008740100001)(33646002)(6806005)(106466001)(11100500001)(76176999)(50986999)(105606002)(5003940100001)(2950100001)(50466002)(48376002)(5001970100001)(77096005)(19580395003)(2351001)(229853001)(92566002)(1096002)(1220700001)(85426001)(110136002)(107886002)(4001430100002)(36756003)(47776003)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR02MB0331; H:ezex10.ezchip.com; FPR:; SPF:Fail; PTR:ezmail.ezchip.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3PR02MB0331; 2:YDpwJ+2LISYiX4bNn6NxgofqFKhhVp3OBYceF9uL3bA9ybC3c1ccXrk3FUiKdEfdSuhwPr9jeDwW2qeAdcYMw6vdTmM6M+qcx/CWTbE95Dajt8oWH9ZDwWuA7upOUD5AaVMAIYlPHoVuF9yYBGOUUg==; 3:aVnkQh2W61I/7q3SiqGmbZpCUZP6Ne+xwXqzLpDX6IkEVngHqbZ1pPxDXgkR1ThLKHex/mMvpkTk3RiwbKCuId0/6o+S2o153WHF9QBcR/ZL6VhoUpxIKnTcJk0J2Ei4ch/rpBZknN1MGFb64gGmg+VhipPqdWbDTldgQ/UeGooTaO0dLt68omVrBs+Qao0SQLI0otGsN1JTYIgYWV27ETpnYA/vLYRaQvxTJM5DzBE=; 25:TCWc/CnKrXzjejsqT46HCr9GmHtcSbHY0K/57jbneAcVJhPkuqjgTw6tMxoma6JpclqX9bAXwHzuqwDkbEhypDFPIroEK1D7yMd42N5+rr3MCg3/bN18UErDkE9l2EOgBAQKp8uXHKX2juTukrYQ012g2SOQ3xrdagnJBz+PGpjy3Hlm9TMnBF3eWlZkmnlyd9ZZwHCf08/0uMn9NP3Y0FVO5xRskdzrdRSfJq7LYwVm3Qg1SprQ4/nyHBfE37VeysW0xp0tAlOupF827/Ca3w==; 20:yZoajPqTuSxxdpSQGg+DXoU9saIkjj4sAHJkvK8rlCPIZW+j3T9RCCohBfgSWZ54PR4/p2786t5SLNTX2YlUDnyWCIaQJvEegZZzXw99OpG3PP84Y3CB0ydm+XwBYro1G+04B2DKQIfrEOOKDeEFgs7YJdnJacVS39PWsO44xFs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB3PR02MB0331; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(121898900299872); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:DB3PR02MB0331; BCL:0; PCL:0; RULEID:; SRVR:DB3PR02MB0331; X-Microsoft-Exchange-Diagnostics: 1; DB3PR02MB0331; 4:GfcnBTHtdo8/xyRMACKD2vTO04oyj1Nvj47bIySLyUE0SLTrQfr/etse57ISQGbKQwa+2qMwo3HY3sJlSR2uFveD3Tnq7JS6FvnUXtK4tUPZuxIp7JSge+SeBv3zsaU2T3YYWP+GThpmLViz0lD+dqB0hvyN7cK9LfwbJk/QClvXHoXoBl25E+uS5X9JoraunbiFGuN1jXYb/lk6AeAFh2ej6RijJxz8oCjI9aHqPSdsXxjFTyNTVGMdlyvQwpsrLNVb7+9UVnDoxy8O4JEZkE1g2KOHGgrj81YcfeU8W9tHdXCgRPzAZYlL1Hpovxw3tMR5habB/Xuif4xAKWyOha8L7ZhmpGnQVRAuuuN5ihJgKib7YyiVJELctXhd/USc7B+Wko3tannEAyK8CsoNG9ZrH+UR+rjHkfbiCtJuc4ZNa8Nr5RhvVFspYW5eoOso X-Forefront-PRVS: 0803A0241F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR02MB0331; 23:ZVjoh1UcRzHGnBHZY3J4O9wfsUT3gbMTnU0vexa9f?= =?us-ascii?Q?dhvRphR2xtsfp/iEjMBXyidT5RbrgIxjRQ371f5yQepx+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ndRG5CkMU1+iawOLOFgir4J/Ou9wUfri3Wc7SxwTKBGs?= =?us-ascii?Q?SwxTq6WMfc5mPrrf2etcKhsZ3gCozeEKPlsaXpleQvNruDFL6FQx3UM5/NW6?= =?us-ascii?Q?i4K+rstDf8HnO37FT1AhF2CddmrpPdbHkeLssBukJQmvUKbROmwAGhx1YcBz?= =?us-ascii?Q?l094aVNz8U=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB3PR02MB0331; 5:/kX3B+aBDa7JNiF5k5/MpPqfa0I8H+CTR7P3tLSqQAFYqgTja8EnXK140LHpCs9vP4mBTdX2TVQ2k8C9f+MxUH8lIpa+Ao4Ed0r5r2lZ9x2P/CRQzGIVjIEphF/r0ARCjwEMXqu81loxIxogG+qoKw==; 24:ILG3aPhSf8S9uTvlBl4vRCozeI9Z4ubPnj5Oa5SdIfTD9BbL9IjEojVolxsNWju4OhkKghPt9Pjx+Yvn0PTuUDaHy9StA+Ff84UGzBH6F5E= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2015 13:29:08.7176 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[212.179.42.66]; Helo=[ezex10.ezchip.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR02MB0331 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151227_052932_425094_25F122B7 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [157.56.112.56 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [157.56.112.56 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.zyngier@arm.com, cmetcalf@ezchip.com, daniel.lezcano@linaro.org, Noam Camus , linux-kernel@vger.kernel.org Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Noam Camus ARC uses hwirq at arch_do_IRQ() to pass into generic_handle_irq(). This is wrong since we need first to reverse map it into virq. Happily, if we use handle_domain_irq() we get all we need. Just like ARM I created a pointer to handler that should be filled by an interrupt controller driver from driver/irqchip/ Signed-off-by: Noam Camus --- arch/arc/Kconfig | 1 + arch/arc/include/asm/irq.h | 5 +++++ arch/arc/kernel/irq.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 7be1020..079946e 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -32,6 +32,7 @@ config ARC select HAVE_OPROFILE select HAVE_PERF_EVENTS select IRQ_DOMAIN + select HANDLE_DOMAIN_IRQ if ARC_PLAT_EZNPS select MODULES_USE_ELF_RELA select NO_BOOTMEM select OF diff --git a/arch/arc/include/asm/irq.h b/arch/arc/include/asm/irq.h index c5f8f0f..64226c9 100644 --- a/arch/arc/include/asm/irq.h +++ b/arch/arc/include/asm/irq.h @@ -36,4 +36,9 @@ void arc_request_percpu_irq(int irq, int cpu, irqreturn_t (*isr)(int irq, void *dev), const char *irq_nm, void *percpu_dev); +#ifdef CONFIG_HANDLE_DOMAIN_IRQ +extern void set_handle_irq(void (*handle_irq)(unsigned int hwirq, + struct pt_regs *)); +#endif + #endif diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index ba17f85..7ae5411 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c @@ -41,6 +41,7 @@ void __init init_IRQ(void) * "C" Entry point for any ARC ISR, called from low level vector handler * @irq is the vector number read from ICAUSE reg of on-chip intc */ +#ifndef CONFIG_HANDLE_DOMAIN_IRQ void arch_do_IRQ(unsigned int irq, struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); @@ -50,6 +51,19 @@ void arch_do_IRQ(unsigned int irq, struct pt_regs *regs) irq_exit(); set_irq_regs(old_regs); } +#else +void (*handle_arch_irq)(unsigned int hwirq, struct pt_regs *) = NULL; +void arch_do_IRQ(unsigned int irq, struct pt_regs *regs) +{ + handle_arch_irq(irq, regs); +} + +void __init set_handle_irq(void (*handle_irq)(unsigned int hwirq, + struct pt_regs *)) +{ + handle_arch_irq = handle_irq; +} +#endif /* * API called for requesting percpu interrupts - called by each CPU