Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'irq-no-autoen-2021-03-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next

Sync up with the tip tree to pick up IRQF_NO_AUTOEN.

+13 -2
+4
include/linux/interrupt.h
··· 61 61 * interrupt handler after suspending interrupts. For system 62 62 * wakeup devices users need to implement wakeup detection in 63 63 * their interrupt handlers. 64 + * IRQF_NO_AUTOEN - Don't enable IRQ or NMI automatically when users request it. 65 + * Users will enable it explicitly by enable_irq() or enable_nmi() 66 + * later. 64 67 */ 65 68 #define IRQF_SHARED 0x00000080 66 69 #define IRQF_PROBE_SHARED 0x00000100 ··· 77 74 #define IRQF_NO_THREAD 0x00010000 78 75 #define IRQF_EARLY_RESUME 0x00020000 79 76 #define IRQF_COND_SUSPEND 0x00040000 77 + #define IRQF_NO_AUTOEN 0x00080000 80 78 81 79 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) 82 80
+9 -2
kernel/irq/manage.c
··· 1697 1697 irqd_set(&desc->irq_data, IRQD_NO_BALANCING); 1698 1698 } 1699 1699 1700 - if (irq_settings_can_autoenable(desc)) { 1700 + if (!(new->flags & IRQF_NO_AUTOEN) && 1701 + irq_settings_can_autoenable(desc)) { 1701 1702 irq_startup(desc, IRQ_RESEND, IRQ_START_COND); 1702 1703 } else { 1703 1704 /* ··· 2091 2090 * which interrupt is which (messes up the interrupt freeing 2092 2091 * logic etc). 2093 2092 * 2093 + * Also shared interrupts do not go well with disabling auto enable. 2094 + * The sharing interrupt might request it while it's still disabled 2095 + * and then wait for interrupts forever. 2096 + * 2094 2097 * Also IRQF_COND_SUSPEND only makes sense for shared interrupts and 2095 2098 * it cannot be set along with IRQF_NO_SUSPEND. 2096 2099 */ 2097 2100 if (((irqflags & IRQF_SHARED) && !dev_id) || 2101 + ((irqflags & IRQF_SHARED) && (irqflags & IRQF_NO_AUTOEN)) || 2098 2102 (!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) || 2099 2103 ((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND))) 2100 2104 return -EINVAL; ··· 2255 2249 2256 2250 desc = irq_to_desc(irq); 2257 2251 2258 - if (!desc || irq_settings_can_autoenable(desc) || 2252 + if (!desc || (irq_settings_can_autoenable(desc) && 2253 + !(irqflags & IRQF_NO_AUTOEN)) || 2259 2254 !irq_settings_can_request(desc) || 2260 2255 WARN_ON(irq_settings_is_per_cpu_devid(desc)) || 2261 2256 !irq_supports_nmi(desc))