linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Make set_handle_irq and handle_arch_irq generic, v3
@ 2018-03-07 23:57 Palmer Dabbelt
  2018-03-07 23:57 ` [PATCH v3 1/5] irq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER Palmer Dabbelt
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Palmer Dabbelt @ 2018-03-07 23:57 UTC (permalink / raw)
  To: linux, catalin.marinas, Will Deacon, jonas, stefan.kristiansson,
	shorne, tglx, linux-arm-kernel, linux-kernel, openrisc,
	linux-riscv

This is my third version of this patch set, but the original cover
letter is still the most relevant description I can come up with.

    This patch set has been sitting around for a while, but it got a bit lost
    in the shuffle.  In RISC-V land we currently couple do_IRQ (the C entry
    point for interrupt handling) to our first-level interrupt controller.
    While this isn't completely crazy (as the first-level interrupt controller
    is specified by the ISA), it is a bit awkward.

    This patch set decouples our trap handler from our first-level IRQ chip
    driver by copying what a handful of other architectures are doing.  This
    does add an additional load to the interrupt handling path, but there's a
    handful of performance problems in there that I've been meaning to look at
    so I don't mind adding another one for now.  The advantage is that our
    irqchip driver is decoupled from our arch port, at least at compile time.

I've build tested this with defconfigs on all the modified architectures
after both patch 1 and 5.  I've left the old acks in for the later
patches as the patch set has changed very little since I last submitted
it.

Changes since v2:

* This is now called CONFIG_GENERIC_IRQ_MULTI_HANDLER instead of
  MULTI_IRQ_HANDLER.
* Rather than converting the ARM code to generic code, this adds new
  generic code (based on the ARM implementation) and then provides
  separate patches to convert each architecture over to use
  CONFIG_GENERIC_IRQ_MULTI_HANDLER.

Changes since v1:

* I based this on arm instead of arm64, which means we guard the selection of
  these routines with CONFIG_MULTI_IRQ_HANDLER.
* The changes are in kernel/irq/handle.c and include/linux/irq.h instead of
  lib.
* I've converted the arm, arm64, and openrisc ports to use the generic versions
  of these routines.


[PATCH v3 1/5] irq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER
[PATCH v3 2/5] RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER
[PATCH v3 3/5] arm: Convert to GENERIC_IRQ_MULTI_HANDLER
[PATCH v3 4/5] arm64: Use the new GENERIC_IRQ_MULTI_HANDLER
[PATCH v3 5/5] openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH 4/5] openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER
@ 2018-06-22 17:01 Palmer Dabbelt
  2018-08-03 10:20 ` [tip:irq/core] " tip-bot for Palmer Dabbelt
  0 siblings, 1 reply; 20+ messages in thread
From: Palmer Dabbelt @ 2018-06-22 17:01 UTC (permalink / raw)
  To: tglx
  Cc: linux, catalin.marinas, Will Deacon, jonas, stefan.kristiansson,
	shorne, jason, marc.zyngier, Arnd Bergmann, nicolas.pitre,
	vladimir.murzin, keescook, jinb.park7, yamada.masahiro,
	alexandre.belloni, Palmer Dabbelt, pombredanne, Greg KH,
	kstewart, jhogan, mark.rutland, ard.biesheuvel, james.morse,
	linux-arm-kernel, linux-kernel, openrisc

It appears that openrisc copied arm64's GENERIC_IRQ_MULTI_HANDLER code
(which came from arm).  I wanted to make this generic so I could use it
in the RISC-V port.  This patch converts the openrisc code to use the
generic version.

Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
---
 arch/openrisc/Kconfig           | 5 +----
 arch/openrisc/include/asm/irq.h | 2 --
 arch/openrisc/kernel/irq.c      | 7 -------
 3 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index 9ecad05bfc73..dfb6a79ba7ff 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -27,7 +27,6 @@ config OPENRISC
 	select GENERIC_STRNLEN_USER
 	select GENERIC_SMP_IDLE_THREAD
 	select MODULES_USE_ELF_RELA
-	select MULTI_IRQ_HANDLER
 	select HAVE_DEBUG_STACKOVERFLOW
 	select OR1K_PIC
 	select CPU_NO_EFFICIENT_FFS if !OPENRISC_HAVE_INST_FF1
@@ -36,6 +35,7 @@ config OPENRISC
 	select ARCH_USE_QUEUED_RWLOCKS
 	select OMPIC if SMP
 	select ARCH_WANT_FRAME_POINTERS
+	select GENERIC_IRQ_MULTI_HANDLER
 
 config CPU_BIG_ENDIAN
 	def_bool y
@@ -69,9 +69,6 @@ config STACKTRACE_SUPPORT
 config LOCKDEP_SUPPORT
 	def_bool  y
 
-config MULTI_IRQ_HANDLER
-	def_bool y
-
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
diff --git a/arch/openrisc/include/asm/irq.h b/arch/openrisc/include/asm/irq.h
index d9eee0a2b7b4..eb612b1865d2 100644
--- a/arch/openrisc/include/asm/irq.h
+++ b/arch/openrisc/include/asm/irq.h
@@ -24,6 +24,4 @@
 
 #define NO_IRQ		(-1)
 
-extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
-
 #endif /* __ASM_OPENRISC_IRQ_H__ */
diff --git a/arch/openrisc/kernel/irq.c b/arch/openrisc/kernel/irq.c
index 35e478a93116..5f9445effaf8 100644
--- a/arch/openrisc/kernel/irq.c
+++ b/arch/openrisc/kernel/irq.c
@@ -41,13 +41,6 @@ void __init init_IRQ(void)
 	irqchip_init();
 }
 
-static void (*handle_arch_irq)(struct pt_regs *);
-
-void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
-{
-	handle_arch_irq = handle_irq;
-}
-
 void __irq_entry do_IRQ(struct pt_regs *regs)
 {
 	handle_arch_irq(regs);
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-08-03 10:21 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v3 2/5] RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler Palmer Dabbelt
2018-03-14 20:49   ` [tip:irq/core] " 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
2018-06-22 17:01 [PATCH 4/5] openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER Palmer Dabbelt
2018-08-03 10:20 ` [tip:irq/core] " tip-bot for Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).