@@ -176,14 +176,26 @@ static void irq_state_set_disabled(struct irq_desc *desc)
176
176
irq_compat_set_disabled (desc );
177
177
}
178
178
179
+ static void irq_state_clr_masked (struct irq_desc * desc )
180
+ {
181
+ desc -> istate &= ~IRQS_MASKED ;
182
+ irq_compat_clr_masked (desc );
183
+ }
184
+
185
+ static void irq_state_set_masked (struct irq_desc * desc )
186
+ {
187
+ desc -> istate |= IRQS_MASKED ;
188
+ irq_compat_set_masked (desc );
189
+ }
190
+
179
191
int irq_startup (struct irq_desc * desc )
180
192
{
181
193
irq_state_clr_disabled (desc );
182
194
desc -> depth = 0 ;
183
195
184
196
if (desc -> irq_data .chip -> irq_startup ) {
185
197
int ret = desc -> irq_data .chip -> irq_startup (& desc -> irq_data );
186
- desc -> status &= ~ IRQ_MASKED ;
198
+ irq_state_clr_masked ( desc ) ;
187
199
return ret ;
188
200
}
189
201
@@ -201,7 +213,7 @@ void irq_shutdown(struct irq_desc *desc)
201
213
desc -> irq_data .chip -> irq_disable (& desc -> irq_data );
202
214
else
203
215
desc -> irq_data .chip -> irq_mask (& desc -> irq_data );
204
- desc -> status |= IRQ_MASKED ;
216
+ irq_state_set_masked ( desc ) ;
205
217
}
206
218
207
219
void irq_enable (struct irq_desc * desc )
@@ -211,16 +223,16 @@ void irq_enable(struct irq_desc *desc)
211
223
desc -> irq_data .chip -> irq_enable (& desc -> irq_data );
212
224
else
213
225
desc -> irq_data .chip -> irq_unmask (& desc -> irq_data );
214
- desc -> status &= ~ IRQ_MASKED ;
226
+ irq_state_clr_masked ( desc ) ;
215
227
}
216
228
217
229
void irq_disable (struct irq_desc * desc )
218
230
{
219
231
irq_state_set_disabled (desc );
220
232
if (desc -> irq_data .chip -> irq_disable ) {
221
233
desc -> irq_data .chip -> irq_disable (& desc -> irq_data );
222
- desc -> status |= IRQ_MASKED ;
223
234
}
235
+ irq_state_set_masked (desc );
224
236
}
225
237
226
238
#ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
@@ -352,22 +364,22 @@ static inline void mask_ack_irq(struct irq_desc *desc)
352
364
if (desc -> irq_data .chip -> irq_ack )
353
365
desc -> irq_data .chip -> irq_ack (& desc -> irq_data );
354
366
}
355
- desc -> status |= IRQ_MASKED ;
367
+ irq_state_set_masked ( desc ) ;
356
368
}
357
369
358
370
static inline void mask_irq (struct irq_desc * desc )
359
371
{
360
372
if (desc -> irq_data .chip -> irq_mask ) {
361
373
desc -> irq_data .chip -> irq_mask (& desc -> irq_data );
362
- desc -> status |= IRQ_MASKED ;
374
+ irq_state_set_masked ( desc ) ;
363
375
}
364
376
}
365
377
366
378
static inline void unmask_irq (struct irq_desc * desc )
367
379
{
368
380
if (desc -> irq_data .chip -> irq_unmask ) {
369
381
desc -> irq_data .chip -> irq_unmask (& desc -> irq_data );
370
- desc -> status &= ~ IRQ_MASKED ;
382
+ irq_state_clr_masked ( desc ) ;
371
383
}
372
384
}
373
385
@@ -583,7 +595,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
583
595
*/
584
596
if (unlikely (desc -> istate & IRQS_PENDING )) {
585
597
if (!(desc -> istate & IRQS_DISABLED ) &&
586
- (desc -> status & IRQ_MASKED ))
598
+ (desc -> istate & IRQS_MASKED ))
587
599
unmask_irq (desc );
588
600
}
589
601
0 commit comments