Received: by 10.223.176.46 with SMTP id f43csp1542082wra; Wed, 24 Jan 2018 19:09:29 -0800 (PST) X-Google-Smtp-Source: AH8x225SqfHExB+555BEnLYhlljezX7TLIE8loBeCFKWqENR73Aq3NmGJdmEpyGs2wNxY/TFXfxv X-Received: by 10.99.99.199 with SMTP id x190mr12133043pgb.193.1516849769345; Wed, 24 Jan 2018 19:09:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516849769; cv=none; d=google.com; s=arc-20160816; b=YrM9vPZH3noZjtmmJw9IT3bJu4SAwDTu3dSQQA6KSqNV4Nfbo0APxbx4zHvMbXysUz 0Hf7VtYjVIjhRxNadUrhZh6vENmtSufRTpQ1b13OZN5Gs8Mjpsvw77XW5iEEVxIUdpbu HTAFM5OhD8sS4GPf7PVnWrmeeONhAuLG9eGUXLuoMeuJLiQ9oSaKLW7kzoCE76oVzeFH JMJiqeVwl/Nkj1XqHaJqyEg3GlWMODMqd39CRjk57Yb3HC1EFava71CU1pma+ifk2+sI mavdP0xXMZvYcqAhX51gVvgef90qp+hjo3O/axLFuS637cFABkqLWjhXiF5kMvFSUOHQ /u8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:from:cc:references:in-reply-to :message-id:date:subject:dkim-signature:arc-authentication-results; bh=wPcKztAVMzbILt9nM8jGAl6hoS9kMs8uiFPj9pY0ons=; b=RiJDO4igjVGnekVwPoK+aRwv60TUASAskbvKIWPuWtoATFYgU+9xJS/jLQzgkrvYwI l0KVw4FUs/uANba7IXKJmhPjV8X2M5NfQ4TGZHpRPp3UyLwNPYFHpA2aRJ8Snrw2sokY W3nuBlxvSAniQ+3FZFSNfViw4rQAnTZvatXsdNUAABWNkbSAvVYDKW8S3g2zEnq5aS2V RW3Lb5wgm590kaSH+k+9VPSgLZ8esCXQ2BVvFQYrEm+XiRF1jnU/hrh8NsXhvOWHViGq ZSzW0JgsxfT2kHpJeKrEWkZzvLVhkN1zQjYWdPwiFR0HI8gJiM4o00Cb05U8Ne1y7SoE /+Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=b11CRHwm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si1190777pld.310.2018.01.24.19.09.15; Wed, 24 Jan 2018 19:09:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=b11CRHwm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933399AbeAYDIh (ORCPT + 99 others); Wed, 24 Jan 2018 22:08:37 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:42582 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933331AbeAYDIU (ORCPT ); Wed, 24 Jan 2018 22:08:20 -0500 Received: by mail-pg0-f65.google.com with SMTP id q67so4169979pga.9 for ; Wed, 24 Jan 2018 19:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:in-reply-to:references:cc:from:to; bh=wPcKztAVMzbILt9nM8jGAl6hoS9kMs8uiFPj9pY0ons=; b=b11CRHwmq1qBb11Mv532dZfsX2ROVyplO1mr+2TO3KLIqjFOK1PY+EU2z8O/6y/Oxq O1dJdCaaTytyKGsFUMxQ6rst5+qrtpGjmeFu9JopEt1VYOmVdo2J3NGg3JkDn//EConv qFLjGOhoYxWbhGksL46KEEXmxdXt6MJUIcQslS0MUNORIL0Iyxuz8O+QIxzFWX/xuFBl Td4C9OPxkUCxKr877ylWxNW87V1y2ci0SI0yVyUwOCG7pQ1Wq+2YZ96CfwpWf8hqqkjX pnzDN08/K4dzzkmv2Ts22tnRfFtwQZrt8hEF4b5rxFxrVQBej0pG7/HGGd8EIlQJjTiW hNRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :cc:from:to; bh=wPcKztAVMzbILt9nM8jGAl6hoS9kMs8uiFPj9pY0ons=; b=Nr/2JkoOu2aC8TsFF328X4Bw3mLfmv5D10ZytZbDUAveBpFtUsm+LglBmNfUELDXkX 9x5uSy6Z3E05Uldgzp4tank3ce7Styr6N+PERR/QU7GEgCRpIOFFuJF69i8+F5MapKQk /ZcXomX3WqM9mgny2xOoYWS8gnOftJHeHyv936wzw3FSSNozQJjHpqZsiJqVYEaNkw5T X68CC8ga+UD7iCfbVNRo2XfJ+V8xn3YiKuCx9Z3MF59uieSus6tzPhnUYBK4NkgLLvUZ Q6NDZ3PYRUY2j7PS/XfT7DYuTbYdCpf+pg6s07HD4d0F+wJpITCKSM5LRH97hoaL2b7l U2Kg== X-Gm-Message-State: AKwxyte1WTujWSZ2k+FaNTqDP4PfuSwe7WsT45EBvU2jv7gcYU1lNN2i FN8nINyXXUogU3Tsfl4ELdrJBimy/wg= X-Received: by 2002:a17:902:b492:: with SMTP id y18-v6mr155454plr.437.1516849699400; Wed, 24 Jan 2018 19:08:19 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id v11sm2128120pgf.83.2018.01.24.19.08.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 19:08:18 -0800 (PST) Subject: [PATCH v2 4/4] RISC-V: Move to the new generic IRQ handler Date: Wed, 24 Jan 2018 19:07:56 -0800 Message-Id: <20180125030756.21787-5-palmer@sifive.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180125030756.21787-1-palmer@sifive.com> References: <20180125030756.21787-1-palmer@sifive.com> Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, patches@groups.riscv.org, Palmer Dabbelt From: Palmer Dabbelt To: linux@armlinux.org.uk, catalin.marinas@arm.com, Will Deacon , jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, tglx@linutronix.de, Christoph Hellwig , Arnd Bergmann Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The old mechanism for handling IRQs on RISC-V was pretty ugly: the arch code looked at the Kconfig entry for our first-level irqchip driver and called into it directly. This patch uses the new 0generic IRQ handling infastructure, which essentially just deletes a bunch of code. This does add an additional load to the interrupt latency, but there's a lot of tuning left to be done there on RISC-V so I think it's OK for now. Signed-off-by: Palmer Dabbelt --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/riscv/kernel/entry.S | 5 +++-- arch/riscv/kernel/irq.c | 13 ------------- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 2c6adf12713a..e67f42178059 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -35,6 +35,7 @@ config RISCV select THREAD_INFO_IN_TASK select RISCV_IRQ_INTC select RISCV_TIMER + select MULTI_IRQ_HANDLER config MMU def_bool y diff --git a/arch/riscv/include/asm/Kbuild b/arch/riscv/include/asm/Kbuild index 970460a0b492..e0d0fbe43ca2 100644 --- a/arch/riscv/include/asm/Kbuild +++ b/arch/riscv/include/asm/Kbuild @@ -16,6 +16,7 @@ generic-y += ftrace.h generic-y += futex.h generic-y += hardirq.h generic-y += hash.h +generic-y += handle_irq.h generic-y += hw_irq.h generic-y += ioctl.h generic-y += ioctls.h diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index 7404ec222406..a79869151aea 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -166,8 +166,9 @@ ENTRY(handle_exception) /* Handle interrupts */ slli a0, s4, 1 srli a0, a0, 1 - move a1, sp /* pt_regs */ - tail do_IRQ + move a0, sp /* pt_regs */ + REG_L a1, handle_arch_irq + jr a1 1: /* Handle syscalls */ li t0, EXC_SYSCALL diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c index 328718e8026e..b74cbfbce2d0 100644 --- a/arch/riscv/kernel/irq.c +++ b/arch/riscv/kernel/irq.c @@ -24,16 +24,3 @@ void __init init_IRQ(void) { irqchip_init(); } - -asmlinkage void __irq_entry do_IRQ(unsigned int cause, struct pt_regs *regs) -{ -#ifdef CONFIG_RISCV_INTC - /* - * FIXME: We don't want a direct call to riscv_intc_irq here. The plan - * is to put an IRQ domain here and let the interrupt controller - * register with that, but I poked around the arm64 code a bit and - * there might be a better way to do it (ie, something fully generic). - */ - riscv_intc_irq(cause, regs); -#endif -} -- 2.13.6