Received: by 10.223.176.46 with SMTP id f43csp1835706wra; Thu, 25 Jan 2018 00:33:45 -0800 (PST) X-Google-Smtp-Source: AH8x225Tnjk7WBxo4/97zJchwg6lElIm//VQWD2j7DPg80P1Yp82IwNVGxHZZhlfSlOXynRCJZWZ X-Received: by 10.98.195.2 with SMTP id v2mr15093753pfg.141.1516869225597; Thu, 25 Jan 2018 00:33:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516869225; cv=none; d=google.com; s=arc-20160816; b=jaIoAsNwYaJzwn415Yxuoy5sEzWeDRo9ngfuSjvED+FmJnKupGwIZvSsJ7aGnyB/VM JZNuLW+RYEN17w0M0CMMVc0EgmbOlBdb7PO4RXmi/7um35DkvA8BT1Lb1XZOIVAjcTjG aiip2+dchP8ClxakSnjnXy+f/FlXnO7nG8Mg/+v+PEzSfJJWMITbFgA7HST+LLYI25Yi KONqSYZc0YjRYP6KhFWcRdPykE4oRidai6uG0syJNbAvnDSLvxIWbSpMBPblAAktZXNC 40PrbEpVGL527SAI7ha206/pbgeXYQFK+5Y1+HO+KlTUiUETdPB2YmmgrKEs+eg9pzA3 eoKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=S7Li7cmHJECojDgD//ZHyE9iPginJ2gO/2at33JrbVs=; b=y1CryJgdmDDKeYK2NqUHEFcPrj1LNitpzFPy0A1TvcM5eSj7HdsSJe5/dAUd44Pquz mqfTzKPgpUvy2mNtqLyTCwGk/ceL10g96jbrveon1F+RTChInP/vsPYKxMz27vnyXvyC 3GII/F4n9+ngZpeZeeXCgR5W/8Q1JF3SuEQswQZQl0D6w8qfxyXA9V0XPtrYd2XzWbmi saWqj7dtF78wMqxpYLwMHd+1Nwpn92YBdNuO2VGwbnra/wuZ0u0jbj6VuFEtO+ZTVOyZ NiRBV7eZfTaBNoiDVQXC2X9cCF5BsTIlSDQrEIDBLjv3S8JDlpo9Bt9qzPMjP7fnzYpp SQcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rxO83nlr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2-v6si1639492plz.168.2018.01.25.00.33.31; Thu, 25 Jan 2018 00:33:45 -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=@gmail.com header.s=20161025 header.b=rxO83nlr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbeAYIb6 (ORCPT + 99 others); Thu, 25 Jan 2018 03:31:58 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33931 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751226AbeAYIb5 (ORCPT ); Thu, 25 Jan 2018 03:31:57 -0500 Received: by mail-pg0-f65.google.com with SMTP id r19so4628341pgn.1 for ; Thu, 25 Jan 2018 00:31:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=S7Li7cmHJECojDgD//ZHyE9iPginJ2gO/2at33JrbVs=; b=rxO83nlrtjISsliCC/hfaAr8qsaq4OgbIadJ9jnl5BLwdXnWdaYrVuFRRT7kv4FA/E 39P5ab04WwsK2rHBvx0pAYz2u/Anj6n8wzCtDbBrmJV9w7XAqzxPGaHduUOWSwCfJG5C QchI2AFwF5F89RN8nhjP3TkL6DmkJxqGwmj69BoCZGPeiRpn9lCw9QWbHBphM55jdO/V WTIHT0wfVpNCgni0ZmulMxDZ5Cp2E3SRYA5apsqSuJPj9OLYmARRjim27u21aOCyGmsY s5/09y3LQM8/Ma5u54nemVYp52zjlSCJBkw9AYA5SYMaRluZtqx/t4vYjmUY61YcopcD lkaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=S7Li7cmHJECojDgD//ZHyE9iPginJ2gO/2at33JrbVs=; b=LPkhamvE3NFyYg8xpsp46vYghIaVtjWOXlkog0Ywu5GIRYgIh9q/fvJAFklcfluFWx LpiwspSdpr7STkxqkE9fJpjCWYHFblWqsFidByRzS4ZLVO2Y5cxhPXG2Bi49SNDpYNUk O/uhY4Jmv94/4yf9OV6WOoF/hm0Ywjz3dcmXYcZZec3ksGC+zOrbfxhKDO15O4LcXiv1 zK7TL8al78O0rUmTgRsCUriys3avQ2EuibrfIM5iBbOTYb3z/fN8GehAxfIz35leOBCJ 7QUyU09/4Ww3OHLZ8VtwjU+UXRQMhfjC4RMA7XjsXUo3Aknc41mkJ5Fh2jJxocZoLMUw TBjg== X-Gm-Message-State: AKwxytfyTKdDwayOwExpkNNybBLc5M3aVv/OPPl0V8Zv45KSZy9TU50K kArQrR1kZQ1KxQffBQnMYVI= X-Received: by 10.101.86.137 with SMTP id v9mr12552759pgs.353.1516869116571; Thu, 25 Jan 2018 00:31:56 -0800 (PST) Received: from localhost (g190.219-103-172.ppp.wakwak.ne.jp. [219.103.172.190]) by smtp.gmail.com with ESMTPSA id f5sm3560585pgn.13.2018.01.25.00.31.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jan 2018 00:31:55 -0800 (PST) Date: Thu, 25 Jan 2018 17:31:53 +0900 From: Stafford Horne To: Palmer Dabbelt Cc: linux@armlinux.org.uk, catalin.marinas@arm.com, Will Deacon , jonas@southpole.se, stefan.kristiansson@saunalahti.fi, tglx@linutronix.de, Christoph Hellwig , Arnd Bergmann , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, patches@groups.riscv.org Subject: Re: [PATCH v2 4/4] RISC-V: Move to the new generic IRQ handler Message-ID: <20180125083153.GI13019@lianli.shorne-pla.net> References: <20180125030756.21787-1-palmer@sifive.com> <20180125030756.21787-5-palmer@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180125030756.21787-5-palmer@sifive.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 24, 2018 at 07:07:56PM -0800, Palmer Dabbelt wrote: > 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 Hi Palmer, Do we need these shifts into a0? I guess these were used when this was an arg to do_IRQ, but no longer needed since you put pt_regs into a0 in the next instruction. Other than that it looks good, and thanks for looking at OpenRISC too. Acked-by: Stafford Horne > - 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 >