hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/kernel/irq/internals.h
....@@ -29,12 +29,14 @@
2929 * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
3030 * IRQTF_AFFINITY - irq thread is requested to adjust affinity
3131 * IRQTF_FORCED_THREAD - irq action is force threaded
32
+ * IRQTF_READY - signals that irq thread is ready
3233 */
3334 enum {
3435 IRQTF_RUNTHREAD,
3536 IRQTF_WARNED,
3637 IRQTF_AFFINITY,
3738 IRQTF_FORCED_THREAD,
39
+ IRQTF_READY,
3840 };
3941
4042 /*
....@@ -49,6 +51,8 @@
4951 * IRQS_WAITING - irq is waiting
5052 * IRQS_PENDING - irq is pending and replayed later
5153 * IRQS_SUSPENDED - irq is suspended
54
+ * IRQS_NMI - irq line is used to deliver NMIs
55
+ * IRQS_SYSFS - descriptor has been added to sysfs
5256 */
5357 enum {
5458 IRQS_AUTODETECT = 0x00000001,
....@@ -60,6 +64,8 @@
6064 IRQS_PENDING = 0x00000200,
6165 IRQS_SUSPENDED = 0x00000800,
6266 IRQS_TIMINGS = 0x00001000,
67
+ IRQS_NMI = 0x00002000,
68
+ IRQS_SYSFS = 0x00004000,
6369 };
6470
6571 #include "debug.h"
....@@ -106,7 +112,7 @@
106112 irqreturn_t handle_irq_event(struct irq_desc *desc);
107113
108114 /* Resending of interrupts :*/
109
-void check_irq_resend(struct irq_desc *desc);
115
+int check_irq_resend(struct irq_desc *desc, bool inject);
110116 bool irq_wait_for_poll(struct irq_desc *desc);
111117 void __irq_wake_thread(struct irq_desc *desc, struct irqaction *action);
112118
....@@ -355,6 +361,16 @@
355361 return value & U16_MAX;
356362 }
357363
364
+static __always_inline void irq_timings_push(u64 ts, int irq)
365
+{
366
+ struct irq_timings *timings = this_cpu_ptr(&irq_timings);
367
+
368
+ timings->values[timings->count & IRQ_TIMINGS_MASK] =
369
+ irq_timing_encode(ts, irq);
370
+
371
+ timings->count++;
372
+}
373
+
358374 /*
359375 * The function record_irq_time is only called in one place in the
360376 * interrupts handler. We want this function always inline so the code
....@@ -368,15 +384,8 @@
368384 if (!static_branch_likely(&irq_timing_enabled))
369385 return;
370386
371
- if (desc->istate & IRQS_TIMINGS) {
372
- struct irq_timings *timings = this_cpu_ptr(&irq_timings);
373
-
374
- timings->values[timings->count & IRQ_TIMINGS_MASK] =
375
- irq_timing_encode(local_clock(),
376
- irq_desc_get_irq(desc));
377
-
378
- timings->count++;
379
- }
387
+ if (desc->istate & IRQS_TIMINGS)
388
+ irq_timings_push(local_clock(), irq_desc_get_irq(desc));
380389 }
381390 #else
382391 static inline void irq_remove_timings(struct irq_desc *desc) {}
....@@ -420,6 +429,10 @@
420429 {
421430 return desc->pending_mask;
422431 }
432
+static inline bool handle_enforce_irqctx(struct irq_data *data)
433
+{
434
+ return irqd_is_handle_enforce_irqctx(data);
435
+}
423436 bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear);
424437 #else /* CONFIG_GENERIC_PENDING_IRQ */
425438 static inline bool irq_can_move_pcntxt(struct irq_data *data)
....@@ -446,6 +459,10 @@
446459 {
447460 return false;
448461 }
462
+static inline bool handle_enforce_irqctx(struct irq_data *data)
463
+{
464
+ return false;
465
+}
449466 #endif /* !CONFIG_GENERIC_PENDING_IRQ */
450467
451468 #if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
....@@ -460,6 +477,15 @@
460477 }
461478 #endif
462479
480
+static inline struct irq_data *irqd_get_parent_data(struct irq_data *irqd)
481
+{
482
+#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
483
+ return irqd->parent_data;
484
+#else
485
+ return NULL;
486
+#endif
487
+}
488
+
463489 #ifdef CONFIG_GENERIC_IRQ_DEBUGFS
464490 #include <linux/debugfs.h>
465491