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

genirq: Move irq_thread_fn() further up in the code

In a preparation to reuse irq_thread_fn() move it further up in the
code. No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241119104339.2112455-2-andriy.shevchenko@linux.intel.com

authored by

Andy Shevchenko and committed by
Thomas Gleixner
6f8b7968 e70140ba

+17 -20
+17 -20
kernel/irq/manage.c
··· 1182 1182 } 1183 1183 1184 1184 /* 1185 + * Interrupts explicitly requested as threaded interrupts want to be 1186 + * preemptible - many of them need to sleep and wait for slow busses to 1187 + * complete. 1188 + */ 1189 + static irqreturn_t irq_thread_fn(struct irq_desc *desc, struct irqaction *action) 1190 + { 1191 + irqreturn_t ret = action->thread_fn(action->irq, action->dev_id); 1192 + 1193 + if (ret == IRQ_HANDLED) 1194 + atomic_inc(&desc->threads_handled); 1195 + 1196 + irq_finalize_oneshot(desc, action); 1197 + return ret; 1198 + } 1199 + 1200 + /* 1185 1201 * Interrupts which are not explicitly requested as threaded 1186 1202 * interrupts rely on the implicit bh/preempt disable of the hard irq 1187 1203 * context. So we need to disable bh here to avoid deadlocks and other 1188 1204 * side effects. 1189 1205 */ 1190 - static irqreturn_t 1191 - irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) 1206 + static irqreturn_t irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) 1192 1207 { 1193 1208 irqreturn_t ret; 1194 1209 ··· 1218 1203 if (!IS_ENABLED(CONFIG_PREEMPT_RT)) 1219 1204 local_irq_enable(); 1220 1205 local_bh_enable(); 1221 - return ret; 1222 - } 1223 - 1224 - /* 1225 - * Interrupts explicitly requested as threaded interrupts want to be 1226 - * preemptible - many of them need to sleep and wait for slow busses to 1227 - * complete. 1228 - */ 1229 - static irqreturn_t irq_thread_fn(struct irq_desc *desc, 1230 - struct irqaction *action) 1231 - { 1232 - irqreturn_t ret; 1233 - 1234 - ret = action->thread_fn(action->irq, action->dev_id); 1235 - if (ret == IRQ_HANDLED) 1236 - atomic_inc(&desc->threads_handled); 1237 - 1238 - irq_finalize_oneshot(desc, action); 1239 1206 return ret; 1240 1207 } 1241 1208