mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@sifive.com>
To: linux@armlinux.org.uk, catalin.marinas@arm.com,
	Will Deacon <will.deacon@arm.com>,
	jonas@southpole.se, stefan.kristiansson@saunalahti.fi,
	shorne@gmail.com, tglx@linutronix.de,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, openrisc@lists.librecores.org,
	linux-riscv@lists.infradead.org
Cc: Palmer Dabbelt <palmer@sifive.com>
Subject: [PATCH v3 2/5] RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler
Date: Wed,  7 Mar 2018 15:57:28 -0800	[thread overview]
Message-ID: <20180307235731.22627-3-palmer@sifive.com> (raw)
In-Reply-To: <20180307235731.22627-1-palmer@sifive.com>

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 generic 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.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 arch/riscv/Kconfig            |  1 +
 arch/riscv/include/asm/Kbuild |  1 +
 arch/riscv/kernel/entry.S     |  7 +++----
 arch/riscv/kernel/irq.c       | 13 -------------
 4 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 04807c7f64cc..148865de1692 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -33,6 +33,7 @@ config RISCV
 	select MODULES_USE_ELF_RELA if MODULES
 	select THREAD_INFO_IN_TASK
 	select RISCV_TIMER
+	select GENERIC_IRQ_MULTI_HANDLER
 
 config MMU
 	def_bool y
diff --git a/arch/riscv/include/asm/Kbuild b/arch/riscv/include/asm/Kbuild
index 4286a5f83876..1e5fd280fb4d 100644
--- a/arch/riscv/include/asm/Kbuild
+++ b/arch/riscv/include/asm/Kbuild
@@ -15,6 +15,7 @@ generic-y += fcntl.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 56fa592cfa34..9aaf6c986771 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -167,10 +167,9 @@ ENTRY(handle_exception)
 	bge s4, zero, 1f
 
 	/* 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:
 	/* Exceptions run with interrupts enabled */
 	csrs sstatus, SR_SIE
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.16.1

  parent reply	other threads:[~2018-03-07 23:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 23:57 Make set_handle_irq and handle_arch_irq generic, v3 Palmer Dabbelt
2018-03-07 23:57 ` [PATCH v3 1/5] irq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER Palmer Dabbelt
2018-03-14 20:48   ` [tip:irq/core] genirq: " tip-bot for Palmer Dabbelt
2018-03-07 23:57 ` Palmer Dabbelt [this message]
2018-03-14 20:49   ` [tip:irq/core] RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler tip-bot for Palmer Dabbelt
2018-03-07 23:57 ` [PATCH v3 3/5] arm: Convert to GENERIC_IRQ_MULTI_HANDLER Palmer Dabbelt
2018-03-14 17:07   ` Thomas Gleixner
2018-03-14 17:28     ` Palmer Dabbelt
2018-03-14 19:36       ` Thomas Gleixner
2018-03-14 20:49   ` [tip:irq/core] ARM: irq: " tip-bot for Palmer Dabbelt
2018-03-07 23:57 ` [PATCH v3 4/5] arm64: Use the new GENERIC_IRQ_MULTI_HANDLER Palmer Dabbelt
2018-03-14 20:50   ` [tip:irq/core] " tip-bot for Palmer Dabbelt
2018-03-07 23:57 ` [PATCH v3 5/5] openrisc: " Palmer Dabbelt
2018-03-12 18:44   ` [PATCH v4] " Palmer Dabbelt
2018-03-14 20:50     ` [tip:irq/core] " tip-bot for Palmer Dabbelt
2018-03-09 10:20 ` Make set_handle_irq and handle_arch_irq generic, v3 Thomas Gleixner
2018-03-09 17:56   ` Palmer Dabbelt
2018-03-09 23:00     ` Thomas Gleixner
2018-03-12 19:24       ` 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=20180307235731.22627-3-palmer@sifive.com \
    --to=palmer@sifive.com \
    --cc=catalin.marinas@arm.com \
    --cc=jonas@southpole.se \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=openrisc@lists.librecores.org \
    --cc=shorne@gmail.com \
    --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®