@@ -1693,7 +1693,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1693
1693
irqd_set (& desc -> irq_data , IRQD_NO_BALANCING );
1694
1694
}
1695
1695
1696
- if (irq_settings_can_autoenable (desc )) {
1696
+ if (!(new -> flags & IRQF_NO_AUTOEN ) &&
1697
+ irq_settings_can_autoenable (desc )) {
1697
1698
irq_startup (desc , IRQ_RESEND , IRQ_START_COND );
1698
1699
} else {
1699
1700
/*
@@ -2086,10 +2087,15 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
2086
2087
* which interrupt is which (messes up the interrupt freeing
2087
2088
* logic etc).
2088
2089
*
2090
+ * Also shared interrupts do not go well with disabling auto enable.
2091
+ * The sharing interrupt might request it while it's still disabled
2092
+ * and then wait for interrupts forever.
2093
+ *
2089
2094
* Also IRQF_COND_SUSPEND only makes sense for shared interrupts and
2090
2095
* it cannot be set along with IRQF_NO_SUSPEND.
2091
2096
*/
2092
2097
if (((irqflags & IRQF_SHARED ) && !dev_id ) ||
2098
+ ((irqflags & IRQF_SHARED ) && (irqflags & IRQF_NO_AUTOEN )) ||
2093
2099
(!(irqflags & IRQF_SHARED ) && (irqflags & IRQF_COND_SUSPEND )) ||
2094
2100
((irqflags & IRQF_NO_SUSPEND ) && (irqflags & IRQF_COND_SUSPEND )))
2095
2101
return - EINVAL ;
@@ -2245,7 +2251,8 @@ int request_nmi(unsigned int irq, irq_handler_t handler,
2245
2251
2246
2252
desc = irq_to_desc (irq );
2247
2253
2248
- if (!desc || irq_settings_can_autoenable (desc ) ||
2254
+ if (!desc || (irq_settings_can_autoenable (desc ) &&
2255
+ !(irqflags & IRQF_NO_AUTOEN )) ||
2249
2256
!irq_settings_can_request (desc ) ||
2250
2257
WARN_ON (irq_settings_is_per_cpu_devid (desc )) ||
2251
2258
!irq_supports_nmi (desc ))
0 commit comments