From: Stafford Horne <shorne@gmail.com>
To: Palmer Dabbelt <palmer@sifive.com>
Cc: linux@armlinux.org.uk, catalin.marinas@arm.com,
Will Deacon <will.deacon@arm.com>,
jonas@southpole.se, stefan.kristiansson@saunalahti.fi,
tglx@linutronix.de, Christoph Hellwig <hch@infradead.org>,
Arnd Bergmann <arnd@arndb.de>,
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
Date: Thu, 25 Jan 2018 17:31:53 +0900 [thread overview]
Message-ID: <20180125083153.GI13019@lianli.shorne-pla.net> (raw)
In-Reply-To: <20180125030756.21787-5-palmer@sifive.com>
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 <palmer@sifive.com>
> ---
> 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 <shorne@gmail.com>
> - 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
>
next prev parent reply other threads:[~2018-01-25 8:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 3:07 Make set_handle_irq and handle_arch_irq generic Palmer Dabbelt
2018-01-25 3:07 ` [PATCH v2 1/4] arm: " Palmer Dabbelt
2018-01-25 7:45 ` Christoph Hellwig
2018-01-25 9:05 ` Thomas Gleixner
2018-01-25 3:07 ` [PATCH v2 2/4] arm64: Use the new MULTI_IRQ_HANDLER Palmer Dabbelt
2018-01-25 7:45 ` Christoph Hellwig
2018-01-25 3:07 ` [PATCH v2 3/4] openrisc: " Palmer Dabbelt
2018-01-25 7:46 ` Christoph Hellwig
2018-01-27 3:13 ` Stafford Horne
2018-01-25 3:07 ` [PATCH v2 4/4] RISC-V: Move to the new generic IRQ handler Palmer Dabbelt
2018-01-25 7:46 ` Christoph Hellwig
2018-01-25 8:31 ` Stafford Horne [this message]
2018-01-25 16:04 ` [patches] " Palmer Dabbelt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180125083153.GI13019@lianli.shorne-pla.net \
--to=shorne@gmail.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=hch@infradead.org \
--cc=jonas@southpole.se \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=palmer@sifive.com \
--cc=patches@groups.riscv.org \
--cc=stefan.kristiansson@saunalahti.fi \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®