[RFC PATCH 1/5] irq: Always enable parent interrupt tracking

Radu Rendec posted 5 patches 2 years, 8 months ago
[RFC PATCH 1/5] irq: Always enable parent interrupt tracking
Posted by Radu Rendec 2 years, 8 months ago
The kernel already has some support for tracking the parent interrupt in
the case of chained interrupts, but it is currently used only by the
IRQ-resend code.

This patch enables the parent interrupt tracking code unconditionally.
The IRQ-resend code still depends on CONFIG_HARDIRQS_SW_RESEND.

The intention is to (re)use the existing parent interrupt tracking
support for different purposes, more specifically to expose chained
interrupt topology to userspace. That, in turn, makes it possible to
control the SMP affinity of chained interrupts in a way that does not
break the existing interface and the promises it makes.

Signed-off-by: Radu Rendec <rrendec@redhat.com>
---
 include/linux/irq.h | 7 -------
 kernel/irq/manage.c | 2 --
 2 files changed, 9 deletions(-)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index b1b28affb32a7..7710f157e12de 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -641,14 +641,7 @@ static inline void irq_force_complete_move(struct irq_desc *desc) { }
 
 extern int no_irq_affinity;
 
-#ifdef CONFIG_HARDIRQS_SW_RESEND
 int irq_set_parent(int irq, int parent_irq);
-#else
-static inline int irq_set_parent(int irq, int parent_irq)
-{
-	return 0;
-}
-#endif
 
 /*
  * Built-in IRQ handlers for various IRQ types,
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index eb862b5f91c42..49683e55261eb 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1004,7 +1004,6 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned long flags)
 	return ret;
 }
 
-#ifdef CONFIG_HARDIRQS_SW_RESEND
 int irq_set_parent(int irq, int parent_irq)
 {
 	unsigned long flags;
@@ -1019,7 +1018,6 @@ int irq_set_parent(int irq, int parent_irq)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(irq_set_parent);
-#endif
 
 /*
  * Default primary interrupt handler for threaded interrupts. Is
-- 
2.40.1
Re: [RFC PATCH 1/5] irq: Always enable parent interrupt tracking
Posted by Thomas Gleixner 2 years, 8 months ago
Radu!

On Tue, May 30 2023 at 17:45, Radu Rendec wrote:

Please read and follow:

    https://www.kernel.org/doc/html/latest/process/maintainer-tip.html

Especially the section about change logs.
   
Thanks,

        tglx
Re: [RFC PATCH 1/5] irq: Always enable parent interrupt tracking
Posted by Radu Rendec 2 years, 8 months ago
On Wed, 2023-05-31 at 15:10 +0200, Thomas Gleixner wrote:
> Please read and follow:
> 
>     https://www.kernel.org/doc/html/latest/process/maintainer-tip.html
> 
> Especially the section about change logs.

Duly noted. Thanks for pointing me to the relevant documentation!

Best regards,
Radu