.. | .. |
---|
342 | 342 | * If the interrupt is not yet activated, just store the affinity |
---|
343 | 343 | * mask and do not call the chip driver at all. On activation the |
---|
344 | 344 | * driver has to make sure anyway that the interrupt is in a |
---|
345 | | - * useable state so startup works. |
---|
| 345 | + * usable state so startup works. |
---|
346 | 346 | */ |
---|
347 | 347 | if (!IS_ENABLED(CONFIG_IRQ_DOMAIN_HIERARCHY) || |
---|
348 | 348 | irqd_is_activated(data) || !irqd_affinity_on_activate(data)) |
---|
.. | .. |
---|
1000 | 1000 | * to IRQS_INPROGRESS and the irq line is masked forever. |
---|
1001 | 1001 | * |
---|
1002 | 1002 | * 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 |
---|
1004 | 1004 | * irq_wake_thread(). See the comment there which explains the |
---|
1005 | 1005 | * serialization. |
---|
1006 | 1006 | */ |
---|
.. | .. |
---|
1202 | 1202 | |
---|
1203 | 1203 | irq_thread_set_ready(desc, action); |
---|
1204 | 1204 | |
---|
1205 | | - sched_set_fifo(current); |
---|
1206 | | - |
---|
1207 | 1205 | if (force_irqthreads && test_bit(IRQTF_FORCED_THREAD, |
---|
1208 | 1206 | &action->thread_flags)) |
---|
1209 | 1207 | handler_fn = irq_forced_thread_fn; |
---|
.. | .. |
---|
1368 | 1366 | |
---|
1369 | 1367 | if (IS_ERR(t)) |
---|
1370 | 1368 | return PTR_ERR(t); |
---|
| 1369 | + |
---|
| 1370 | + sched_set_fifo(t); |
---|
1371 | 1371 | |
---|
1372 | 1372 | /* |
---|
1373 | 1373 | * We keep the reference to the task struct even if |
---|
.. | .. |
---|
1668 | 1668 | irqd_set(&desc->irq_data, IRQD_NO_BALANCING); |
---|
1669 | 1669 | } |
---|
1670 | 1670 | |
---|
1671 | | - if (irq_settings_can_autoenable(desc)) { |
---|
| 1671 | + if (!(new->flags & IRQF_NO_AUTOEN) && |
---|
| 1672 | + irq_settings_can_autoenable(desc)) { |
---|
1672 | 1673 | irq_startup(desc, IRQ_RESEND, IRQ_START_COND); |
---|
1673 | 1674 | } else { |
---|
1674 | 1675 | /* |
---|
.. | .. |
---|
1877 | 1878 | /* Last action releases resources */ |
---|
1878 | 1879 | if (!desc->action) { |
---|
1879 | 1880 | /* |
---|
1880 | | - * Reaquire bus lock as irq_release_resources() might |
---|
| 1881 | + * Reacquire bus lock as irq_release_resources() might |
---|
1881 | 1882 | * require it to deallocate resources over the slow bus. |
---|
1882 | 1883 | */ |
---|
1883 | 1884 | chip_bus_lock(desc); |
---|
.. | .. |
---|
2055 | 2056 | * which interrupt is which (messes up the interrupt freeing |
---|
2056 | 2057 | * logic etc). |
---|
2057 | 2058 | * |
---|
| 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 | + * |
---|
2058 | 2063 | * Also IRQF_COND_SUSPEND only makes sense for shared interrupts and |
---|
2059 | 2064 | * it cannot be set along with IRQF_NO_SUSPEND. |
---|
2060 | 2065 | */ |
---|
2061 | 2066 | if (((irqflags & IRQF_SHARED) && !dev_id) || |
---|
| 2067 | + ((irqflags & IRQF_SHARED) && (irqflags & IRQF_NO_AUTOEN)) || |
---|
2062 | 2068 | (!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) || |
---|
2063 | 2069 | ((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND))) |
---|
2064 | 2070 | return -EINVAL; |
---|
.. | .. |
---|
2214 | 2220 | |
---|
2215 | 2221 | desc = irq_to_desc(irq); |
---|
2216 | 2222 | |
---|
2217 | | - if (!desc || irq_settings_can_autoenable(desc) || |
---|
| 2223 | + if (!desc || (irq_settings_can_autoenable(desc) && |
---|
| 2224 | + !(irqflags & IRQF_NO_AUTOEN)) || |
---|
2218 | 2225 | !irq_settings_can_request(desc) || |
---|
2219 | 2226 | WARN_ON(irq_settings_is_per_cpu_devid(desc)) || |
---|
2220 | 2227 | !irq_supports_nmi(desc)) |
---|
.. | .. |
---|
2750 | 2757 | * This call sets the internal irqchip state of an interrupt, |
---|
2751 | 2758 | * depending on the value of @which. |
---|
2752 | 2759 | * |
---|
2753 | | - * This function should be called with migration disabled if the |
---|
| 2760 | + * This function should be called with preemption disabled if the |
---|
2754 | 2761 | * interrupt controller has per-cpu registers. |
---|
2755 | 2762 | */ |
---|
2756 | 2763 | int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, |
---|