Skip to contentSkip to conversation

genirq: Kill preflow handlers

PATCH Applied Valentin Schneider 5 participants 9 messages Jul 3, 2020 – Jul 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover genirq: Kill preflow handlers

Hi,

while strolling around the different flow handlers, I tried to make sense of what preflow_handler() was about. Turns out no one uses those anymore, but the genirq support has remained in place.

Unless we can see another user of those in the near future, this seems like as good a time as any for a little housecleaning.

- Patch 1 simply deselects the (unexploited) preflow Kconfig for sparc64
- Patch 2 is the actual cleanup

Cheers,
Valentin

Valentin Schneider (2):
sparc64: Deselect IRQ_PREFLOW_FASTEOI
genirq: Remove preflow handler support

 arch/sparc/Kconfig         |  1 -
 include/linux/irqdesc.h    | 15 ---------------
 include/linux/irqhandler.h |  1 -
 kernel/irq/Kconfig         |  4 ----
 kernel/irq/chip.c          | 13 -------------
 5 files changed, 34 deletions(-)

--
2.27.0

#1 lore raw

PATCH 1/2 sparc64: Deselect IRQ_PREFLOW_FASTEOI

sparc64 hasn't needed to select this since commit:

ee6a9333fa58 ("sparc64: sparse irq")

which got rid of the calls to __irq_set_preflow_handler() first installed by commit:

fcd8d4f49869 ("sparc: Use the new genirq functionality")

Deselect this option.

---
 arch/sparc/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/sparc/Kconfig +0 -1
index da515fdad83d..ed35760043e8 100644
@@ -81,7 +81,6 @@ config SPARC64
 	select RTC_DRV_STARFIRE
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
-	select IRQ_PREFLOW_FASTEOI
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select HAVE_C_RECORDMCOUNT
 	select HAVE_ARCH_AUDITSYSCALL
Signature · 1 line
2.27.0
#2 lore raw

Re: [PATCH 1/2] sparc64: Deselect IRQ_PREFLOW_FASTEOI

Quoted 22 lines · Valentin Schneider

sparc64 hasn't needed to select this since commit:

ee6a9333fa58 ("sparc64: sparse irq")

which got rid of the calls to __irq_set_preflow_handler() first installed by commit:

fcd8d4f49869 ("sparc: Use the new genirq functionality")

Deselect this option.

---
 arch/sparc/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/sparc/Kconfig +0 -0
index da515fdad83d..ed35760043e8 100644

arch/sparc/Kconfig config SPARC64 · line 86

Quoted 7 lines
arch/sparc/Kconfig +0 -1
@@ -81,7 +81,6 @@ config SPARC64
        select RTC_DRV_STARFIRE
        select HAVE_PERF_EVENTS
        select PERF_USE_VMALLOC
-       select IRQ_PREFLOW_FASTEOI
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select HAVE_C_RECORDMCOUNT
        select HAVE_ARCH_AUDITSYSCALL

tried/tested this patch on my test sparc64 ldom , boots ok

#3 lore raw

[tip: irq/core] sparc64: Deselect IRQ_PREFLOW_FASTEOI

In reply to Valentin Schneider
The following commit has been merged into the irq/core branch of tip:

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     959f53bd90c3ac70e5481199c6159f6314f9f910
Gitweb:        https://git.kernel.org/tip/959f53bd90c3ac70e5481199c6159f6314f9f910
Author:        Valentin Schneider <[email protected]>
AuthorDate:    Fri, 03 Jul 2020 16:56:44 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sat, 04 Jul 2020 10:02:06 +02:00

sparc64: Deselect IRQ_PREFLOW_FASTEOI

sparc64 hasn't needed to select this since commit:

ee6a9333fa58 ("sparc64: sparse irq")

which got rid of the calls to __irq_set_preflow_handler() first installed by commit:

fcd8d4f49869 ("sparc: Use the new genirq functionality")

Deselect this option.

---
 arch/sparc/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/sparc/Kconfig +0 -1
index 5bf2dc1..76f4078 100644
@@ -80,7 +80,6 @@ config SPARC64
 	select RTC_DRV_STARFIRE
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
-	select IRQ_PREFLOW_FASTEOI
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select HAVE_C_RECORDMCOUNT
 	select HAVE_ARCH_AUDITSYSCALL
maintainer Acked-by on v1 1/2
#4 lore raw

Re: [PATCH 1/2] sparc64: Deselect IRQ_PREFLOW_FASTEOI

In reply to Valentin Schneider

From: Valentin Schneider <[email protected]>
Date: Fri, 3 Jul 2020 16:56:44 +0100

Quoted 4 lines

sparc64 hasn't needed to select this since commit:

ee6a9333fa58 ("sparc64: sparse irq")

Quoted 8 lines

which got rid of the calls to __irq_set_preflow_handler() first installed by commit:

fcd8d4f49869 ("sparc: Use the new genirq functionality")

Deselect this option.

#5 lore raw

PATCH 2/2 genirq: Remove preflow handler support

In reply to Valentin Schneider

That was put in place for sparc64, and blackfin also used it for some time; sparc64 no longer uses those, and blackfin is dead.

As there are no more users, remove preflow handlers.

---
 include/linux/irqdesc.h    | 15 ---------------
 include/linux/irqhandler.h |  1 -
 kernel/irq/Kconfig         |  4 ----
 kernel/irq/chip.c          | 13 -------------
 4 files changed, 33 deletions(-)
include/linux/irqdesc.h +0 -15
index 8f2820c5e69e..5745491303e0 100644
@@ -22,7 +22,6 @@ struct pt_regs;
  * @irq_common_data:	per irq and chip data passed down to chip functions
  * @kstat_irqs:		irq stats per cpu
  * @handle_irq:		highlevel irq-events handler
- * @preflow_handler:	handler called before the flow handler (currently used by sparc)
  * @action:		the irq action chain
  * @status_use_accessors: status information
  * @core_internal_state__do_not_mess_with_it: core internal status information
@@ -58,9 +57,6 @@ struct irq_desc {
 	struct irq_data		irq_data;
 	unsigned int __percpu	*kstat_irqs;
 	irq_flow_handler_t	handle_irq;
-#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-	irq_preflow_handler_t	preflow_handler;
-#endif
 	struct irqaction	*action;	/* IRQ action list */
 	unsigned int		status_use_accessors;
 	unsigned int		core_internal_state__do_not_mess_with_it;
@@ -268,15 +264,4 @@ irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class,
 	}
 }
 
-#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-static inline void
-__irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
-{
-	struct irq_desc *desc;
-
-	desc = irq_to_desc(irq);
-	desc->preflow_handler = handler;
-}
-#endif
-
 #endif
include/linux/irqhandler.h +0 -1
index 1e6f4e7123d6..c30f454a9518 100644
@@ -10,6 +10,5 @@
 struct irq_desc;
 struct irq_data;
 typedef	void (*irq_flow_handler_t)(struct irq_desc *desc);
-typedef	void (*irq_preflow_handler_t)(struct irq_data *data);
 
 #endif
kernel/irq/Kconfig +0 -4
index d63c324895ea..58f0e996a2c3 100644
@@ -51,10 +51,6 @@ config GENERIC_IRQ_INJECTION
 config HARDIRQS_SW_RESEND
        bool
 
-# Preflow handler support for fasteoi (sparc64)
-config IRQ_PREFLOW_FASTEOI
-       bool
-
 # Edge style eoi based handler (cell)
 config IRQ_EDGE_EOI_HANDLER
        bool
kernel/irq/chip.c +0 -13
index 41e7e37a0928..75bbaa8b38f1 100644
@@ -656,16 +656,6 @@ void handle_level_irq(struct irq_desc *desc)
 }
 EXPORT_SYMBOL_GPL(handle_level_irq);
 
-#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-static inline void preflow_handler(struct irq_desc *desc)
-{
-	if (desc->preflow_handler)
-		desc->preflow_handler(&desc->irq_data);
-}
-#else
-static inline void preflow_handler(struct irq_desc *desc) { }
-#endif
-
 static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
 {
 	if (!(desc->istate & IRQS_ONESHOT)) {
@@ -721,7 +711,6 @@ void handle_fasteoi_irq(struct irq_desc *desc)
 	if (desc->istate & IRQS_ONESHOT)
 		mask_irq(desc);
 
-	preflow_handler(desc);
 	handle_irq_event(desc);
 
 	cond_unmask_eoi_irq(desc, chip);
@@ -1231,7 +1220,6 @@ void handle_fasteoi_ack_irq(struct irq_desc *desc)
 	/* Start handling the irq */
 	desc->irq_data.chip->irq_ack(&desc->irq_data);
 
-	preflow_handler(desc);
 	handle_irq_event(desc);
 
 	cond_unmask_eoi_irq(desc, chip);
@@ -1281,7 +1269,6 @@ void handle_fasteoi_mask_irq(struct irq_desc *desc)
 	if (desc->istate & IRQS_ONESHOT)
 		mask_irq(desc);
 
-	preflow_handler(desc);
 	handle_irq_event(desc);
 
 	cond_unmask_eoi_irq(desc, chip);
Signature · 1 line
2.27.0
#6 lore raw

[tip: irq/core] genirq: Remove preflow handler support

The following commit has been merged into the irq/core branch of tip:

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     8fa88a88d573093868565a1afba43b5ae5b3a316
Gitweb:        https://git.kernel.org/tip/8fa88a88d573093868565a1afba43b5ae5b3a316
Author:        Valentin Schneider <[email protected]>
AuthorDate:    Fri, 03 Jul 2020 16:56:45 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sat, 04 Jul 2020 10:02:06 +02:00

genirq: Remove preflow handler support

That was put in place for sparc64, and blackfin also used it for some time; sparc64 no longer uses those, and blackfin is dead.

As there are no more users, remove preflow handlers.

---
 include/linux/irqdesc.h    | 15 ---------------
 include/linux/irqhandler.h |  1 -
 kernel/irq/Kconfig         |  4 ----
 kernel/irq/chip.c          | 13 -------------
 4 files changed, 33 deletions(-)
include/linux/irqdesc.h +0 -15
index 8f2820c..5745491 100644
@@ -22,7 +22,6 @@ struct pt_regs;
  * @irq_common_data:	per irq and chip data passed down to chip functions
  * @kstat_irqs:		irq stats per cpu
  * @handle_irq:		highlevel irq-events handler
- * @preflow_handler:	handler called before the flow handler (currently used by sparc)
  * @action:		the irq action chain
  * @status_use_accessors: status information
  * @core_internal_state__do_not_mess_with_it: core internal status information
@@ -58,9 +57,6 @@ struct irq_desc {
 	struct irq_data		irq_data;
 	unsigned int __percpu	*kstat_irqs;
 	irq_flow_handler_t	handle_irq;
-#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-	irq_preflow_handler_t	preflow_handler;
-#endif
 	struct irqaction	*action;	/* IRQ action list */
 	unsigned int		status_use_accessors;
 	unsigned int		core_internal_state__do_not_mess_with_it;
@@ -268,15 +264,4 @@ irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class,
 	}
 }
 
-#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-static inline void
-__irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
-{
-	struct irq_desc *desc;
-
-	desc = irq_to_desc(irq);
-	desc->preflow_handler = handler;
-}
-#endif
-
 #endif
include/linux/irqhandler.h +0 -1
index 1e6f4e7..c30f454 100644
@@ -10,6 +10,5 @@
 struct irq_desc;
 struct irq_data;
 typedef	void (*irq_flow_handler_t)(struct irq_desc *desc);
-typedef	void (*irq_preflow_handler_t)(struct irq_data *data);
 
 #endif
kernel/irq/Kconfig +0 -4
index 2051225..10a5aff 100644
@@ -51,10 +51,6 @@ config GENERIC_IRQ_INJECTION
 config HARDIRQS_SW_RESEND
        bool
 
-# Preflow handler support for fasteoi (sparc64)
-config IRQ_PREFLOW_FASTEOI
-       bool
-
 # Edge style eoi based handler (cell)
 config IRQ_EDGE_EOI_HANDLER
        bool
kernel/irq/chip.c +0 -13
index 41e7e37..75bbaa8 100644
@@ -656,16 +656,6 @@ out_unlock:
 }
 EXPORT_SYMBOL_GPL(handle_level_irq);
 
-#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-static inline void preflow_handler(struct irq_desc *desc)
-{
-	if (desc->preflow_handler)
-		desc->preflow_handler(&desc->irq_data);
-}
-#else
-static inline void preflow_handler(struct irq_desc *desc) { }
-#endif
-
 static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
 {
 	if (!(desc->istate & IRQS_ONESHOT)) {
@@ -721,7 +711,6 @@ void handle_fasteoi_irq(struct irq_desc *desc)
 	if (desc->istate & IRQS_ONESHOT)
 		mask_irq(desc);
 
-	preflow_handler(desc);
 	handle_irq_event(desc);
 
 	cond_unmask_eoi_irq(desc, chip);
@@ -1231,7 +1220,6 @@ void handle_fasteoi_ack_irq(struct irq_desc *desc)
 	/* Start handling the irq */
 	desc->irq_data.chip->irq_ack(&desc->irq_data);
 
-	preflow_handler(desc);
 	handle_irq_event(desc);
 
 	cond_unmask_eoi_irq(desc, chip);
@@ -1281,7 +1269,6 @@ void handle_fasteoi_mask_irq(struct irq_desc *desc)
 	if (desc->istate & IRQS_ONESHOT)
 		mask_irq(desc);
 
-	preflow_handler(desc);
 	handle_irq_event(desc);
 
 	cond_unmask_eoi_irq(desc, chip);
Reviewed-by on the v1 series
#7 lore raw
In reply to Valentin Schneider

Hi Valentin,

Quoted 7 lines · Valentin Schneider

Hi,

while strolling around the different flow handlers, I tried to make sense of
what preflow_handler() was about. Turns out no one uses those anymore, but the
genirq support has remained in place.

If we needed to reintroduce some form of preflow handler, we'd try and do it using hierarchical irqchips, if at all possible.

Quoted 16 lines

Unless we can see another user of those in the near future, this seems like as
good a time as any for a little housecleaning.

- Patch 1 simply deselects the (unexploited) preflow Kconfig for sparc64
- Patch 2 is the actual cleanup

Cheers,
Valentin

Valentin Schneider (2):
sparc64: Deselect IRQ_PREFLOW_FASTEOI
genirq: Remove preflow handler support

Quoted 6 lines
 arch/sparc/Kconfig         |  1 -
 include/linux/irqdesc.h    | 15 ---------------
 include/linux/irqhandler.h |  1 -
 kernel/irq/Kconfig         |  4 ----
 kernel/irq/chip.c          | 13 -------------
 5 files changed, 34 deletions(-)

For the whole series, and assuming that there is no regression (can't imagine any for unused code):

Thanks,

         M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#8 lore raw

Hi Marc,

Quoted 5 lines · Marc Zyngier

Hi Valentin,

Quoted 2 lines · Valentin Schneider

Hi,

Quoted 8 lines
Quoted 5 lines

while strolling around the different flow handlers, I tried to make sense of
what preflow_handler() was about. Turns out no one uses those anymore, but the
genirq support has remained in place.

If we needed to reintroduce some form of preflow handler, we'd try and do it using hierarchical irqchips, if at all possible.

Right, that does sound like the most sensible approach. If I got my history right, the preflow handlers saw the light of day before hierarchical domains did, which I suppose is a reason why it wasn't done that way back then.

Quoted 24 lines
Quoted 17 lines

Unless we can see another user of those in the near future, this seems like as
good a time as any for a little housecleaning.

- Patch 1 simply deselects the (unexploited) preflow Kconfig for sparc64
- Patch 2 is the actual cleanup

Cheers,
Valentin

Valentin Schneider (2):
sparc64: Deselect IRQ_PREFLOW_FASTEOI
genirq: Remove preflow handler support

Quoted 6 lines
 arch/sparc/Kconfig         |  1 -
 include/linux/irqdesc.h    | 15 ---------------
 include/linux/irqhandler.h |  1 -
 kernel/irq/Kconfig         |  4 ----
 kernel/irq/chip.c          | 13 -------------
 5 files changed, 34 deletions(-)
Quoted 5 lines

For the whole series, and assuming that there is no regression (can't imagine any for unused code):

Thanks!

Quoted 3 lines

Thanks,

         M.