Skip to contentSkip to conversation

irq/debug: implement missing FIXME in print_irq_desc()

PATCH Applied yangfeng 2 participants 2 messages Sep 4 – Nov 8 IRQ

lore
Share & tools
lore

yangfeng

author
#0 lore raw

PATCH v2 1/1 irq/debug: implement missing FIXME in print_irq_desc()

The original code ___PD(f) left a FIXME, so fix it.
The maximum length of a macro is 19, so modify the printk() from 14 to 20.

v2:
- Implement missing FIXME in ___PD() with __irqd_to_state
- move the define of __irqd_to_state before "include debug.h" in internals.h
- Adjust printk() width from 14 to 20
- Use full legal name in Signed-off-by
- Rebase to latest master

---
 kernel/irq/debug.h     | 13 ++++++-------
 kernel/irq/internals.h |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)
kernel/irq/debug.h +6 -7
index 8ccb326d2977..451439135bed 100644
@@ -3,10 +3,9 @@
  * Debugging printout:
  */
 
-#define ___P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f)
-#define ___PS(f) if (desc->istate & f) printk("%14s set\n", #f)
-/* FIXME */
-#define ___PD(f) do { } while (0)
+#define ___P(f) if (desc->status_use_accessors & f) printk("%20s set\n", #f)
+#define ___PS(f) if (desc->istate & f) printk("%20s set\n", #f)
+#define ___PD(f) if (__irqd_to_state(&(desc->irq_data)) & f) printk("%20s set\n", #f)
 
 static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
 {
@@ -39,9 +38,9 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
 	___PS(IRQS_WAITING);
 	___PS(IRQS_PENDING);
 
-	___PD(IRQS_INPROGRESS);
-	___PD(IRQS_DISABLED);
-	___PD(IRQS_MASKED);
+	___PD(IRQD_IRQ_INPROGRESS);
+	___PD(IRQD_IRQ_DISABLED);
+	___PD(IRQD_IRQ_MASKED);
 }
 
 #undef ___P
kernel/irq/internals.h +2 -2
index 0ce21dd45404..43fe07a25b66 100644
@@ -77,6 +77,8 @@ enum {
 	IRQS_SYSFS		= 0x00004000,
 };
 
+#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
+
 #include "debug.h"
 #include "settings.h"
 
@@ -215,8 +217,6 @@ static inline class_irqdesc_lock_t class_irqdesc_lock_constructor(unsigned int i
 
 #define scoped_irqdesc		((struct irq_desc *)(__guard_ptr(irqdesc_lock)(&scope)))
 
-#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
-
 static inline unsigned int irqd_get(struct irq_data *d)
 {
 	return __irqd_to_state(d);
Signature · 1 line
2.43.0
merge bot Applied
#1 lore raw

[tip: irq/core] genirq/debug: Re-implement flags printks in print_irq_desc()

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:     403e2849fb51a1b8ca06a5fe70d75ee635d79520
Gitweb:        https://git.kernel.org/tip/403e2849fb51a1b8ca06a5fe70d75ee635d79520
Author:        yangfeng <[email protected]>
AuthorDate:    Fri, 04 Sep 2026 21:51:17 +09:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sun, 08 Nov 2026 17:39:43 +01:00

genirq/debug: Re-implement flags printks in print_irq_desc()

When the INPROGRESS/DISABLED/MASKED flags where moved from the interrupt descriptor state to irq_desc::irq_data the related debug printks were disabled and not fixed up.

Re-implement them so the state printouts are complete.

v2:
- Implement missing FIXME in ___PD() with __irqd_to_state
- move the define of __irqd_to_state before "include debug.h" in internals.h
- Adjust printk() width from 14 to 20
- Use full legal name in Signed-off-by
- Rebase to latest master

---
 kernel/irq/debug.h     | 13 ++++++-------
 kernel/irq/internals.h |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)
kernel/irq/debug.h +6 -7
index 8ccb326..4514391 100644
@@ -3,10 +3,9 @@
  * Debugging printout:
  */
 
-#define ___P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f)
-#define ___PS(f) if (desc->istate & f) printk("%14s set\n", #f)
-/* FIXME */
-#define ___PD(f) do { } while (0)
+#define ___P(f) if (desc->status_use_accessors & f) printk("%20s set\n", #f)
+#define ___PS(f) if (desc->istate & f) printk("%20s set\n", #f)
+#define ___PD(f) if (__irqd_to_state(&(desc->irq_data)) & f) printk("%20s set\n", #f)
 
 static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
 {
@@ -39,9 +38,9 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
 	___PS(IRQS_WAITING);
 	___PS(IRQS_PENDING);
 
-	___PD(IRQS_INPROGRESS);
-	___PD(IRQS_DISABLED);
-	___PD(IRQS_MASKED);
+	___PD(IRQD_IRQ_INPROGRESS);
+	___PD(IRQD_IRQ_DISABLED);
+	___PD(IRQD_IRQ_MASKED);
 }
 
 #undef ___P
kernel/irq/internals.h +2 -2
index 703a062..daa1507 100644
@@ -79,6 +79,8 @@ enum {
 	IRQS_SYSFS		= 0x00004000,
 };
 
+#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
+
 #include "debug.h"
 #include "settings.h"
 
@@ -218,8 +220,6 @@ static inline class_irqdesc_lock_t class_irqdesc_lock_constructor(unsigned int i
 
 #define scoped_irqdesc		((struct irq_desc *)(__guard_ptr(irqdesc_lock)(&scope)))
 
-#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
-
 static inline unsigned int irqd_get(struct irq_data *d)
 {
 	return __irqd_to_state(d);