@@ -140,27 +140,25 @@ EXPORT_SYMBOL_GPL(irq_get_irq_data);
140140
141141static void irq_state_clr_disabled (struct irq_desc * desc )
142142{
143- desc -> istate &= ~IRQS_DISABLED ;
144143 irqd_clear (& desc -> irq_data , IRQD_IRQ_DISABLED );
145144 irq_compat_clr_disabled (desc );
146145}
147146
148147static void irq_state_set_disabled (struct irq_desc * desc )
149148{
150- desc -> istate |= IRQS_DISABLED ;
151149 irqd_set (& desc -> irq_data , IRQD_IRQ_DISABLED );
152150 irq_compat_set_disabled (desc );
153151}
154152
155153static void irq_state_clr_masked (struct irq_desc * desc )
156154{
157- desc -> istate &= ~ IRQS_MASKED ;
155+ irqd_clear ( & desc -> irq_data , IRQD_IRQ_MASKED ) ;
158156 irq_compat_clr_masked (desc );
159157}
160158
161159static void irq_state_set_masked (struct irq_desc * desc )
162160{
163- desc -> istate |= IRQS_MASKED ;
161+ irqd_set ( & desc -> irq_data , IRQD_IRQ_MASKED ) ;
164162 irq_compat_set_masked (desc );
165163}
166164
@@ -380,19 +378,19 @@ void handle_nested_irq(unsigned int irq)
380378 kstat_incr_irqs_this_cpu (irq , desc );
381379
382380 action = desc -> action ;
383- if (unlikely (!action || ( desc -> istate & IRQS_DISABLED )))
381+ if (unlikely (!action || irqd_irq_disabled ( & desc -> irq_data )))
384382 goto out_unlock ;
385383
386384 irq_compat_set_progress (desc );
387- desc -> istate |= IRQS_INPROGRESS ;
385+ irqd_set ( & desc -> irq_data , IRQD_IRQ_INPROGRESS ) ;
388386 raw_spin_unlock_irq (& desc -> lock );
389387
390388 action_ret = action -> thread_fn (action -> irq , action -> dev_id );
391389 if (!noirqdebug )
392390 note_interrupt (irq , desc , action_ret );
393391
394392 raw_spin_lock_irq (& desc -> lock );
395- desc -> istate &= ~ IRQS_INPROGRESS ;
393+ irqd_clear ( & desc -> irq_data , IRQD_IRQ_INPROGRESS ) ;
396394 irq_compat_clr_progress (desc );
397395
398396out_unlock :
@@ -424,14 +422,14 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc)
424422{
425423 raw_spin_lock (& desc -> lock );
426424
427- if (unlikely (desc -> istate & IRQS_INPROGRESS ))
425+ if (unlikely (irqd_irq_inprogress ( & desc -> irq_data ) ))
428426 if (!irq_check_poll (desc ))
429427 goto out_unlock ;
430428
431429 desc -> istate &= ~(IRQS_REPLAY | IRQS_WAITING );
432430 kstat_incr_irqs_this_cpu (irq , desc );
433431
434- if (unlikely (!desc -> action || ( desc -> istate & IRQS_DISABLED )))
432+ if (unlikely (!desc -> action || irqd_irq_disabled ( & desc -> irq_data )))
435433 goto out_unlock ;
436434
437435 handle_irq_event (desc );
@@ -456,7 +454,7 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
456454 raw_spin_lock (& desc -> lock );
457455 mask_ack_irq (desc );
458456
459- if (unlikely (desc -> istate & IRQS_INPROGRESS ))
457+ if (unlikely (irqd_irq_inprogress ( & desc -> irq_data ) ))
460458 if (!irq_check_poll (desc ))
461459 goto out_unlock ;
462460
@@ -467,12 +465,12 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
467465 * If its disabled or no action available
468466 * keep it masked and get out of here
469467 */
470- if (unlikely (!desc -> action || ( desc -> istate & IRQS_DISABLED )))
468+ if (unlikely (!desc -> action || irqd_irq_disabled ( & desc -> irq_data )))
471469 goto out_unlock ;
472470
473471 handle_irq_event (desc );
474472
475- if (!( desc -> istate & ( IRQS_DISABLED | IRQS_ONESHOT ) ))
473+ if (!irqd_irq_disabled ( & desc -> irq_data ) && !( desc -> istate & IRQS_ONESHOT ))
476474 unmask_irq (desc );
477475out_unlock :
478476 raw_spin_unlock (& desc -> lock );
@@ -504,7 +502,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
504502{
505503 raw_spin_lock (& desc -> lock );
506504
507- if (unlikely (desc -> istate & IRQS_INPROGRESS ))
505+ if (unlikely (irqd_irq_inprogress ( & desc -> irq_data ) ))
508506 if (!irq_check_poll (desc ))
509507 goto out ;
510508
@@ -515,7 +513,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
515513 * If its disabled or no action available
516514 * then mask it and get out of here:
517515 */
518- if (unlikely (!desc -> action || ( desc -> istate & IRQS_DISABLED ))) {
516+ if (unlikely (!desc -> action || irqd_irq_disabled ( & desc -> irq_data ))) {
519517 irq_compat_set_pending (desc );
520518 desc -> istate |= IRQS_PENDING ;
521519 mask_irq (desc );
@@ -566,8 +564,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
566564 * we shouldn't process the IRQ. Mark it pending, handle
567565 * the necessary masking and go out
568566 */
569- if (unlikely (( desc -> istate & ( IRQS_DISABLED | IRQS_INPROGRESS ) ||
570- !desc -> action ) )) {
567+ if (unlikely (irqd_irq_disabled ( & desc -> irq_data ) ||
568+ irqd_irq_inprogress ( & desc -> irq_data ) || !desc -> action )) {
571569 if (!irq_check_poll (desc )) {
572570 irq_compat_set_pending (desc );
573571 desc -> istate |= IRQS_PENDING ;
@@ -592,15 +590,15 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
592590 * Renable it, if it was not disabled in meantime.
593591 */
594592 if (unlikely (desc -> istate & IRQS_PENDING )) {
595- if (!( desc -> istate & IRQS_DISABLED ) &&
596- ( desc -> istate & IRQS_MASKED ))
593+ if (!irqd_irq_disabled ( & desc -> irq_data ) &&
594+ irqd_irq_masked ( & desc -> irq_data ))
597595 unmask_irq (desc );
598596 }
599597
600598 handle_irq_event (desc );
601599
602600 } while ((desc -> istate & IRQS_PENDING ) &&
603- !( desc -> istate & IRQS_DISABLED ));
601+ !irqd_irq_disabled ( & desc -> irq_data ));
604602
605603out_unlock :
606604 raw_spin_unlock (& desc -> lock );
@@ -720,7 +718,7 @@ void irq_cpu_online(void)
720718 chip = irq_data_get_irq_chip (& desc -> irq_data );
721719 if (chip && chip -> irq_cpu_online &&
722720 (!(chip -> flags & IRQCHIP_ONOFFLINE_ENABLED ) ||
723- !( desc -> istate & IRQS_DISABLED )))
721+ !irqd_irq_disabled ( & desc -> irq_data )))
724722 chip -> irq_cpu_online (& desc -> irq_data );
725723
726724 raw_spin_unlock_irqrestore (& desc -> lock , flags );
@@ -750,7 +748,7 @@ void irq_cpu_offline(void)
750748 chip = irq_data_get_irq_chip (& desc -> irq_data );
751749 if (chip && chip -> irq_cpu_offline &&
752750 (!(chip -> flags & IRQCHIP_ONOFFLINE_ENABLED ) ||
753- !( desc -> istate & IRQS_DISABLED )))
751+ !irqd_irq_disabled ( & desc -> irq_data )))
754752 chip -> irq_cpu_offline (& desc -> irq_data );
755753
756754 raw_spin_unlock_irqrestore (& desc -> lock , flags );
0 commit comments