hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
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 */
....@@ -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))