From patchwork Sun Dec 27 13:23:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noam Camus X-Patchwork-Id: 561161 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 6E780140CE3 for ; Mon, 28 Dec 2015 00:29:39 +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 1aDBOD-00013E-Ua; Sun, 27 Dec 2015 13:29:37 +0000 Received: from mail-db3on0073.outbound.protection.outlook.com ([157.55.234.73] helo=emea01-db3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDBOB-000118-2x for linux-snps-arc@lists.infradead.org; Sun, 27 Dec 2015 13:29:36 +0000 Received: from VI1PR02CA0019.eurprd02.prod.outlook.com (2a01:111:e400:581f::29) by AM3PR02MB1218.eurprd02.prod.outlook.com (2a01:111:e400:c407::12) with Microsoft SMTP Server (TLS) id 15.1.361.13; Sun, 27 Dec 2015 13:29:11 +0000 Received: from DB3FFO11FD042.protection.gbl (2a01:111:f400:7e04::187) by VI1PR02CA0019.outlook.office365.com (2a01:111:e400:581f::29) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Sun, 27 Dec 2015 13:29:11 +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 DB3FFO11FD042.mail.protection.outlook.com (10.47.217.73) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sun, 27 Dec 2015 13:29:10 +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:29:09 +0200 From: Noam Camus To: Subject: [PATCH v5 11/20] ARC: IPI: do not use generic IRQ domain Date: Sun, 27 Dec 2015 15:23:30 +0200 Message-ID: <1451222619-3610-12-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--8.670500-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; DB3FFO11FD042; 1:/FmeYpheifLDqcdfKfnGtc4GmrlvhU0fr5xQ618XtGgVKAv0f/gkWgaD9OMjz3nkfEW0dge8WaPXEWh/sz6RCBwLOey+uOqG1sdBBf2NpIaHRjz1e1SIT7TBoNk5iZPN4JWnnk15O+e0PRmn6br/uiN0oTpVnYkkoVoil+82Jy6WNgGuf1Nz8jCg6cxAyf1xSUpCJz8HyXJiKJ4MMOcf6vlaLp8T2deKciQC1wtpr0FHn1pQViWUMF1wQ6lTjlADfb0hBbdAsrMdEu93m20pIKPGM1kbIWJRgTbVkN0kpt+ijZ3B/TVmb707dW5CsPkVPpyRXR+6Yjxx6gTfXy8YPdSw+jguWSvQJ3Jq9uaiW121lS9fjGlZlrlFmaLwoM69RavrUGoIkxLqhf9gQ23O42CuBKLYTwzFw6XrgjbPhiE= X-Forefront-Antispam-Report: CIP:212.179.42.66; CTRY:IL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(86362001)(11100500001)(77096005)(33646002)(50466002)(2950100001)(229853001)(48376002)(87936001)(1096002)(5008740100001)(4001430100002)(19580405001)(1220700001)(49486002)(2351001)(50986999)(5003940100001)(586003)(106466001)(5001970100001)(6806005)(85426001)(76176999)(105606002)(47776003)(50226001)(104016004)(92566002)(189998001)(107886002)(36756003)(110136002)(19580395003)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR02MB1218; H:ezex10.ezchip.com; FPR:; SPF:Fail; PTR:ezmail.ezchip.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM3PR02MB1218; 2:DOEh3RyUd7CX67ZitCdzs2+j5qVoRlRRlFXlr0JMre+J8NSwGDX4R31uJfeHcrjIbMMou/Ej2Vk5C1xHmHivAg87IqrpnxwGsq+yvycHeYdSyhAPUchs4trVtdTZneQviyz42LJ9veoMrhQNJGDT8Q==; 3:uIQ18PkNI0hLD0MyE40MbYRFMGVz0Awp/ZktRm0zU0sEB26TkNcCsgJmwtkYVcL8V+YrjMCkevhmWl3dzlu0tNrcBOLlMSRP+7EvyAbjJJwX60gan+b6V6+jix0y8qRbLZYTYIrEbT9uj87WOm4r5Y/aB91FmGtnDbsdioHa1gtJA86iD1efb3xOazXT5LRY1mhLfAlXp54pfsLaqWR1rEOWvjSjXo26IP2vHcfgJFI=; 25:fh/XYUhL9omgT4OeAZyRYxBJe/d+L+PbxK5zhyWLfMOadGtUlkI8IWYciBaJiVJ73djsXpd2WGjoGE92tbZkinpxTuOVKXcbdUXJR1G/9QpzHpajgPMDc4w80GC6ITW/ljKvpRl6/Rmyu3r7jEKx5DeoTZMwueEOxhALHSG1h06YZpcNkRMiTlm49YSLlOFBvZrSJbvspqY9X6IFEFQfOKOo/rN7st1Cs6q405HBiccgs9No8WdX1u6T2xqpKE+eEF3XCKQqF0XNzQIcOkpt4Q==; 20:sNLhJu5SIDHvv0+fmSmY/OfCAcOXdemDqFQ5yxYQw6TZLPgp79MZvoWadU/wGxPjjzU5I6P0VNNLJsioVBb92HBoH/bVCOnRRjYnM+iS3babNloHnOu4NyeMdhCK6xlyTg0DaXoNPDDWCyR48GPJYUtaCpJNo/RIzYCHJqGiONE= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB1218; 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:AM3PR02MB1218; BCL:0; PCL:0; RULEID:; SRVR:AM3PR02MB1218; X-Microsoft-Exchange-Diagnostics: 1; AM3PR02MB1218; 4:uXs688AOv4Hl5AucGoosqo15t/jCuePOTF/RPvgHDXaqHnyKTRbxtAfIgQ/s541XN+lthc3Ezzt8cs5henBhYLLvsX06PqpXxSufA3oec2PMJ9gb3vOKXr4t4fbfvxIDBmj21Sy+hYKxg/7CGnDQByfS1i9FGsRaaiGurYdy+oJSb9zF5VJSdg0hFrTD/C39cYlmPvmb1VxRt4sHCF8IP+6xQnsm2Hr9ej845KjPmYYg8gvpONgP2i9gO6YfaoDYzf6geVdpawTnUV6aAgFloaq3pW50y9VKQ2mVhMil7A1ADS6oSNzZdT2bNrS/LJC4CTq+25d7TiG/esW3W6imyNTFXZJisFEH52TtMPVrNsfS69WUsL4uRUiFOfucDS3jKEuXYo6vHB0WU3u3+/KD71q49cDHWjIeM6eCQiCxM2tofrMVIX06D94O0hs/LfgO X-Forefront-PRVS: 0803A0241F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR02MB1218; 23:EsTPPZhvNH4h4znFOg3GkRKt7tjjv7HK+jldDLu2N?= =?us-ascii?Q?iIa7mjGG3S2Eb1mojuoux/4/exkV2jk/p1vgo/8wR5Htn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RJOf4kyQxAFFiVvH5cSHObznmzDku?= =?us-ascii?Q?3nux3hAH2yzCJ3q6zK5FUUHM6K1GhOc0yrhTVs4+2jTMxYQpN3Sv6HgSdCdZ?= =?us-ascii?Q?8hLKFCGJb9pcEXdoRBKKMUE23RUI7QGRcr85gSKU4QmyZ0xmSmNWUVHAV+77?= =?us-ascii?Q?A6m6R4G+7E=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM3PR02MB1218; 5:m+jNBC2xTjyShHy11iFFUAqIyiA21uNh98OII3j2PwMGFY2rxsJhyu5vKSW/NvyUI7QGDbvttKNHM2tET99kCwN5fHoA9E+Fps/9/yXcaCZdjcQG6WLce9aLM3hFSdM4dOrSH7ss0QPBVAhSU/o8aA==; 24:NdiQqLObQFYf20kGiMO9P/gf12NSq4bxXMzeSOSVAaygyvzTH+TxceOO49hEBx9bEAfip/Z3EKl47Feqo6MHpD7dKT6HzjRMQurZZPfhj/4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2015 13:29:10.7159 (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: AM3PR02MB1218 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151227_052935_628079_1D9A62BD X-CRM114-Status: GOOD ( 15.74 ) 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.55.234.73 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [157.55.234.73 listed in wl.mailspike.net] -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 This behaviour is the desired one as been seen on other arch's. We do not use generic irq domain and hence hwirq number is used directly by our code without any mapping to virq. In order to add IPI status to /proc/interrupts we use hardirq macros also we define arch_show_interrupts(). Signed-off-by: Noam Camus --- arch/arc/include/asm/Kbuild | 1 - arch/arc/include/asm/hardirq.h | 22 ++++++++++++++++++++++ arch/arc/include/asm/smp.h | 6 ++++++ arch/arc/kernel/irq.c | 13 ++++++++++++- arch/arc/kernel/smp.c | 27 +++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 arch/arc/include/asm/hardirq.h diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index 0b10ef2..bbc3e4a 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild @@ -10,7 +10,6 @@ generic-y += errno.h generic-y += fb.h generic-y += fcntl.h generic-y += ftrace.h -generic-y += hardirq.h generic-y += hw_irq.h generic-y += ioctl.h generic-y += ioctls.h diff --git a/arch/arc/include/asm/hardirq.h b/arch/arc/include/asm/hardirq.h new file mode 100644 index 0000000..e83aa88 --- /dev/null +++ b/arch/arc/include/asm/hardirq.h @@ -0,0 +1,22 @@ +#ifndef __ASM_ARC_HARDIRQ_H +#define __ASM_ARC_HARDIRQ_H + +#include +#include + +typedef struct { + unsigned int __softirq_pending; +#ifdef CONFIG_SMP + unsigned int ipi_irqs; +#endif +} ____cacheline_aligned irq_cpustat_t; + +#include /* Standard mappings for irq_cpustat_t above */ +#include + +static inline void ack_bad_irq(unsigned int irq) +{ + printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); +} + +#endif /* __ASM_ARC_HARDIRQ_H */ diff --git a/arch/arc/include/asm/smp.h b/arch/arc/include/asm/smp.h index 9913804..9e4ec48 100644 --- a/arch/arc/include/asm/smp.h +++ b/arch/arc/include/asm/smp.h @@ -14,12 +14,16 @@ #include #include #include +#include #define raw_smp_processor_id() (current_thread_info()->cpu) /* including cpumask.h leads to cyclic deps hence this Forward declaration */ struct cpumask; +/* including seq_file.h leads to cyclic deps hence this Forward declaration */ +struct seq_file; + /* * APIs provided by arch SMP code to generic code */ @@ -32,6 +36,8 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); extern void __init smp_init_cpus(void); extern void first_lines_of_secondary(void); extern const char *arc_platform_smp_cpuinfo(void); +extern void arch_do_IPI(unsigned int irq, struct pt_regs *regs); +extern void show_ipi_list(struct seq_file *, int); /* * API expected BY platform smp code (FROM arch smp code) diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index 7ae5411..c8d3c3d 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c @@ -55,7 +55,10 @@ void arch_do_IRQ(unsigned int irq, struct pt_regs *regs) 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); + if (irq == IPI_IRQ) + arch_do_IPI(irq, regs); + else + handle_arch_irq(irq, regs); } void __init set_handle_irq(void (*handle_irq)(unsigned int hwirq, @@ -65,6 +68,14 @@ void __init set_handle_irq(void (*handle_irq)(unsigned int hwirq, } #endif +int arch_show_interrupts(struct seq_file *p, int prec) +{ +#ifdef CONFIG_SMP + show_ipi_list(p, prec); +#endif + return 0; +} + /* * API called for requesting percpu interrupts - called by each CPU * - For boot CPU, actually request the IRQ with genirq core + enables diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c index ec6a5c1..8d37906 100644 --- a/arch/arc/kernel/smp.c +++ b/arch/arc/kernel/smp.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -349,6 +350,32 @@ irqreturn_t do_IPI(int irq, void *dev_id) return IRQ_HANDLED; } +void arch_do_IPI(unsigned int irq, struct pt_regs *regs) +{ + struct pt_regs *old_regs = set_irq_regs(regs); + unsigned int cpu = smp_processor_id(); + + __IRQ_STAT(cpu, ipi_irqs)++; + + irq_enter(); + do_IPI(irq, NULL); + irq_exit(); + + set_irq_regs(old_regs); +} + +void show_ipi_list(struct seq_file *p, int prec) +{ + unsigned int cpu; + + seq_printf(p, "%*s: ", prec - 1, "IPI"); + + for_each_online_cpu(cpu) + seq_printf(p, "%10u ", __IRQ_STAT(cpu, ipi_irqs)); + + seq_printf(p, " %s\n", "IPI"); +} + /* * API called by platform code to hookup arch-common ISR to their IPI IRQ */