@@ -34,8 +34,9 @@ static atomic_t irq_poll_active;
3434 * true and let the handler run.
3535 */
3636bool irq_wait_for_poll (struct irq_desc * desc )
37- __must_hold (& desc - > lock )
3837{
38+ lockdep_assert_held (& desc -> lock );
39+
3940 if (WARN_ONCE (irq_poll_cpu == smp_processor_id (),
4041 "irq poll in progress on cpu %d for irq %d\n" ,
4142 smp_processor_id (), desc -> irq_data .irq ))
@@ -157,8 +158,7 @@ static void poll_spurious_irqs(struct timer_list *unused)
157158 continue ;
158159
159160 /* Racy but it doesn't matter */
160- state = desc -> istate ;
161- barrier ();
161+ state = READ_ONCE (desc -> istate );
162162 if (!(state & IRQS_SPURIOUS_DISABLED ))
163163 continue ;
164164
@@ -168,8 +168,7 @@ static void poll_spurious_irqs(struct timer_list *unused)
168168 }
169169out :
170170 atomic_dec (& irq_poll_active );
171- mod_timer (& poll_spurious_irq_timer ,
172- jiffies + POLL_SPURIOUS_IRQ_INTERVAL );
171+ mod_timer (& poll_spurious_irq_timer , jiffies + POLL_SPURIOUS_IRQ_INTERVAL );
173172}
174173
175174static inline int bad_action_ret (irqreturn_t action_ret )
@@ -195,15 +194,12 @@ static void __report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret)
195194 struct irqaction * action ;
196195 unsigned long flags ;
197196
198- if (bad_action_ret (action_ret )) {
199- printk (KERN_ERR "irq event %d: bogus return value %x\n" ,
200- irq , action_ret );
201- } else {
202- printk (KERN_ERR "irq %d: nobody cared (try booting with "
203- "the \"irqpoll\" option)\n" , irq );
204- }
197+ if (bad_action_ret (action_ret ))
198+ pr_err ("irq event %d: bogus return value %x\n" , irq , action_ret );
199+ else
200+ pr_err ("irq %d: nobody cared (try booting with the \"irqpoll\" option)\n" , irq );
205201 dump_stack ();
206- printk ( KERN_ERR "handlers:\n" );
202+ pr_err ( "handlers:\n" );
207203
208204 /*
209205 * We need to take desc->lock here. note_interrupt() is called
@@ -213,11 +209,10 @@ static void __report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret)
213209 */
214210 raw_spin_lock_irqsave (& desc -> lock , flags );
215211 for_each_action_of_desc (desc , action ) {
216- printk ( KERN_ERR "[<%p>] %ps" , action -> handler , action -> handler );
212+ pr_err ( "[<%p>] %ps" , action -> handler , action -> handler );
217213 if (action -> thread_fn )
218- printk (KERN_CONT " threaded [<%p>] %ps" ,
219- action -> thread_fn , action -> thread_fn );
220- printk (KERN_CONT "\n" );
214+ pr_cont (" threaded [<%p>] %ps" , action -> thread_fn , action -> thread_fn );
215+ pr_cont ("\n" );
221216 }
222217 raw_spin_unlock_irqrestore (& desc -> lock , flags );
223218}
@@ -232,38 +227,34 @@ static void report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret)
232227 }
233228}
234229
235- static inline int
236- try_misrouted_irq (unsigned int irq , struct irq_desc * desc ,
237- irqreturn_t action_ret )
230+ static inline bool try_misrouted_irq (unsigned int irq , struct irq_desc * desc ,
231+ irqreturn_t action_ret )
238232{
239233 struct irqaction * action ;
240234
241235 if (!irqfixup )
242- return 0 ;
236+ return false ;
243237
244238 /* We didn't actually handle the IRQ - see if it was misrouted? */
245239 if (action_ret == IRQ_NONE )
246- return 1 ;
240+ return true ;
247241
248242 /*
249243 * But for 'irqfixup == 2' we also do it for handled interrupts if
250244 * they are marked as IRQF_IRQPOLL (or for irq zero, which is the
251245 * traditional PC timer interrupt.. Legacy)
252246 */
253247 if (irqfixup < 2 )
254- return 0 ;
248+ return false ;
255249
256250 if (!irq )
257- return 1 ;
251+ return true ;
258252
259253 /*
260254 * Since we don't get the descriptor lock, "action" can
261- * change under us. We don't really care, but we don't
262- * want to follow a NULL pointer. So tell the compiler to
263- * just load it once by using a barrier.
255+ * change under us.
264256 */
265- action = desc -> action ;
266- barrier ();
257+ action = READ_ONCE (desc -> action );
267258 return action && (action -> flags & IRQF_IRQPOLL );
268259}
269260
@@ -273,8 +264,7 @@ void note_interrupt(struct irq_desc *desc, irqreturn_t action_ret)
273264{
274265 unsigned int irq ;
275266
276- if (desc -> istate & IRQS_POLL_INPROGRESS ||
277- irq_settings_is_polled (desc ))
267+ if (desc -> istate & IRQS_POLL_INPROGRESS || irq_settings_is_polled (desc ))
278268 return ;
279269
280270 if (bad_action_ret (action_ret )) {
@@ -420,13 +410,12 @@ void note_interrupt(struct irq_desc *desc, irqreturn_t action_ret)
420410 /*
421411 * Now kill the IRQ
422412 */
423- printk ( KERN_EMERG "Disabling IRQ #%d\n" , irq );
413+ pr_emerg ( "Disabling IRQ #%d\n" , irq );
424414 desc -> istate |= IRQS_SPURIOUS_DISABLED ;
425415 desc -> depth ++ ;
426416 irq_disable (desc );
427417
428- mod_timer (& poll_spurious_irq_timer ,
429- jiffies + POLL_SPURIOUS_IRQ_INTERVAL );
418+ mod_timer (& poll_spurious_irq_timer , jiffies + POLL_SPURIOUS_IRQ_INTERVAL );
430419 }
431420 desc -> irqs_unhandled = 0 ;
432421}
@@ -436,11 +425,9 @@ bool noirqdebug __read_mostly;
436425int noirqdebug_setup (char * str )
437426{
438427 noirqdebug = 1 ;
439- printk (KERN_INFO "IRQ lockup detection disabled\n" );
440-
428+ pr_info ("IRQ lockup detection disabled\n" );
441429 return 1 ;
442430}
443-
444431__setup ("noirqdebug" , noirqdebug_setup );
445432module_param (noirqdebug , bool , 0644 );
446433MODULE_PARM_DESC (noirqdebug , "Disable irq lockup detection when true" );
@@ -452,12 +439,10 @@ static int __init irqfixup_setup(char *str)
452439 return 1 ;
453440 }
454441 irqfixup = 1 ;
455- printk (KERN_WARNING "Misrouted IRQ fixup support enabled.\n" );
456- printk (KERN_WARNING "This may impact system performance.\n" );
457-
442+ pr_warn ("Misrouted IRQ fixup support enabled.\n" );
443+ pr_warn ("This may impact system performance.\n" );
458444 return 1 ;
459445}
460-
461446__setup ("irqfixup" , irqfixup_setup );
462447module_param (irqfixup , int , 0644 );
463448
@@ -468,11 +453,8 @@ static int __init irqpoll_setup(char *str)
468453 return 1 ;
469454 }
470455 irqfixup = 2 ;
471- printk (KERN_WARNING "Misrouted IRQ fixup and polling support "
472- "enabled\n" );
473- printk (KERN_WARNING "This may significantly impact system "
474- "performance\n" );
456+ pr_warn ("Misrouted IRQ fixup and polling support enabled\n" );
457+ pr_warn ("This may significantly impact system performance\n" );
475458 return 1 ;
476459}
477-
478460__setup ("irqpoll" , irqpoll_setup );
0 commit comments