hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/kernel/irq/manage.c
....@@ -342,7 +342,7 @@
342342 * If the interrupt is not yet activated, just store the affinity
343343 * mask and do not call the chip driver at all. On activation the
344344 * driver has to make sure anyway that the interrupt is in a
345
- * useable state so startup works.
345
+ * usable state so startup works.
346346 */
347347 if (!IS_ENABLED(CONFIG_IRQ_DOMAIN_HIERARCHY) ||
348348 irqd_is_activated(data) || !irqd_affinity_on_activate(data))
....@@ -1000,7 +1000,7 @@
10001000 * to IRQS_INPROGRESS and the irq line is masked forever.
10011001 *
10021002 * This also serializes the state of shared oneshot handlers
1003
- * versus "desc->threads_onehsot |= action->thread_mask;" in
1003
+ * versus "desc->threads_oneshot |= action->thread_mask;" in
10041004 * irq_wake_thread(). See the comment there which explains the
10051005 * serialization.
10061006 */
....@@ -1202,8 +1202,6 @@
12021202
12031203 irq_thread_set_ready(desc, action);
12041204
1205
- sched_set_fifo(current);
1206
-
12071205 if (force_irqthreads && test_bit(IRQTF_FORCED_THREAD,
12081206 &action->thread_flags))
12091207 handler_fn = irq_forced_thread_fn;
....@@ -1368,6 +1366,8 @@
13681366
13691367 if (IS_ERR(t))
13701368 return PTR_ERR(t);
1369
+
1370
+ sched_set_fifo(t);
13711371
13721372 /*
13731373 * We keep the reference to the task struct even if
....@@ -1668,7 +1668,8 @@
16681668 irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
16691669 }
16701670
1671
- if (irq_settings_can_autoenable(desc)) {
1671
+ if (!(new->flags & IRQF_NO_AUTOEN) &&
1672
+ irq_settings_can_autoenable(desc)) {
16721673 irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
16731674 } else {
16741675 /*
....@@ -1877,7 +1878,7 @@
18771878 /* Last action releases resources */
18781879 if (!desc->action) {
18791880 /*
1880
- * Reaquire bus lock as irq_release_resources() might
1881
+ * Reacquire bus lock as irq_release_resources() might
18811882 * require it to deallocate resources over the slow bus.
18821883 */
18831884 chip_bus_lock(desc);
....@@ -2055,10 +2056,15 @@
20552056 * which interrupt is which (messes up the interrupt freeing
20562057 * logic etc).
20572058 *
2059
+ * Also shared interrupts do not go well with disabling auto enable.
2060
+ * The sharing interrupt might request it while it's still disabled
2061
+ * and then wait for interrupts forever.
2062
+ *
20582063 * Also IRQF_COND_SUSPEND only makes sense for shared interrupts and
20592064 * it cannot be set along with IRQF_NO_SUSPEND.
20602065 */
20612066 if (((irqflags & IRQF_SHARED) && !dev_id) ||
2067
+ ((irqflags & IRQF_SHARED) && (irqflags & IRQF_NO_AUTOEN)) ||
20622068 (!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) ||
20632069 ((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND)))
20642070 return -EINVAL;
....@@ -2214,7 +2220,8 @@
22142220
22152221 desc = irq_to_desc(irq);
22162222
2217
- if (!desc || irq_settings_can_autoenable(desc) ||
2223
+ if (!desc || (irq_settings_can_autoenable(desc) &&
2224
+ !(irqflags & IRQF_NO_AUTOEN)) ||
22182225 !irq_settings_can_request(desc) ||
22192226 WARN_ON(irq_settings_is_per_cpu_devid(desc)) ||
22202227 !irq_supports_nmi(desc))
....@@ -2750,7 +2757,7 @@
27502757 * This call sets the internal irqchip state of an interrupt,
27512758 * depending on the value of @which.
27522759 *
2753
- * This function should be called with migration disabled if the
2760
+ * This function should be called with preemption disabled if the
27542761 * interrupt controller has per-cpu registers.
27552762 */
27562763 int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which,