~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to kernel/irq/chip.c

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2012-03-04 15:32:20 UTC
  • mto: (43.1.29 sid)
  • mto: This revision was merged to the branch mainline in revision 57.
  • Revision ID: package-import@ubuntu.com-20120304153220-z43emb9b8y0vpuf2
Tags: upstream-3.2.9
ImportĀ upstreamĀ versionĀ 3.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
        irqd_set(&desc->irq_data, IRQD_IRQ_MASKED);
158
158
}
159
159
 
160
 
int irq_startup(struct irq_desc *desc)
 
160
int irq_startup(struct irq_desc *desc, bool resend)
161
161
{
 
162
        int ret = 0;
 
163
 
162
164
        irq_state_clr_disabled(desc);
163
165
        desc->depth = 0;
164
166
 
165
167
        if (desc->irq_data.chip->irq_startup) {
166
 
                int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
 
168
                ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
167
169
                irq_state_clr_masked(desc);
168
 
                return ret;
 
170
        } else {
 
171
                irq_enable(desc);
169
172
        }
170
 
 
171
 
        irq_enable(desc);
172
 
        return 0;
 
173
        if (resend)
 
174
                check_irq_resend(desc, desc->irq_data.irq);
 
175
        return ret;
173
176
}
174
177
 
175
178
void irq_shutdown(struct irq_desc *desc)
330
333
}
331
334
EXPORT_SYMBOL_GPL(handle_simple_irq);
332
335
 
 
336
/*
 
337
 * Called unconditionally from handle_level_irq() and only for oneshot
 
338
 * interrupts from handle_fasteoi_irq()
 
339
 */
 
340
static void cond_unmask_irq(struct irq_desc *desc)
 
341
{
 
342
        /*
 
343
         * We need to unmask in the following cases:
 
344
         * - Standard level irq (IRQF_ONESHOT is not set)
 
345
         * - Oneshot irq which did not wake the thread (caused by a
 
346
         *   spurious interrupt or a primary handler handling it
 
347
         *   completely).
 
348
         */
 
349
        if (!irqd_irq_disabled(&desc->irq_data) &&
 
350
            irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot)
 
351
                unmask_irq(desc);
 
352
}
 
353
 
333
354
/**
334
355
 *      handle_level_irq - Level type irq handler
335
356
 *      @irq:   the interrupt number
362
383
 
363
384
        handle_irq_event(desc);
364
385
 
365
 
        if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT))
366
 
                unmask_irq(desc);
 
386
        cond_unmask_irq(desc);
 
387
 
367
388
out_unlock:
368
389
        raw_spin_unlock(&desc->lock);
369
390
}
417
438
        preflow_handler(desc);
418
439
        handle_irq_event(desc);
419
440
 
 
441
        if (desc->istate & IRQS_ONESHOT)
 
442
                cond_unmask_irq(desc);
 
443
 
420
444
out_eoi:
421
445
        desc->irq_data.chip->irq_eoi(&desc->irq_data);
422
446
out_unlock:
625
649
                irq_settings_set_noprobe(desc);
626
650
                irq_settings_set_norequest(desc);
627
651
                irq_settings_set_nothread(desc);
628
 
                irq_startup(desc);
 
652
                irq_startup(desc, true);
629
653
        }
630
654
out:
631
655
        irq_put_desc_busunlock(desc, flags);