Ticket #2180: interrupt_handling_time_detector.patch

File interrupt_handling_time_detector.patch, 1.7 KB (added by Sascha, 9 years ago)
  • arch/arm/kernel/iblock.c

    diff --git a/arch/arm/kernel/iblock.c b/arch/arm/kernel/iblock.c
    index 87b9804..4863273 100644
    a b unsigned long s3c2410_gettimeoffset(void); 
    2929 
    3030 
    3131static unsigned long iblock_t0; 
    32 static int iblock_limit; 
     32int iblock_limit; 
    3333static int iblock_max; 
    3434 
    3535 
    void iblock_end(void) 
    6464                return; 
    6565        if (us < iblock_limit) 
    6666                return; 
    67         iblock_limit = 0; 
     67//      iblock_limit = 0; 
    6868        printk(KERN_ERR "interrupts were disabled for %lu us !\n", us); 
    69         WARN_ON(1); 
     69//      WARN_ON(1); 
    7070} 
    7171EXPORT_SYMBOL_GPL(iblock_end); 
    7272 
  • arch/arm/kernel/irq.c

    diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
    index 7141cee..573d546 100644
    a b static struct irq_desc bad_irq_desc = { 
    104104        .lock = SPIN_LOCK_UNLOCKED 
    105105}; 
    106106 
     107extern int iblock_limit; 
     108unsigned long s3c2410_gettimeoffset(void); 
     109 
    107110/* 
    108111 * do_IRQ handles all hardware IRQ's.  Decoded IRQs should not 
    109112 * come via this function.  Instead, they should provide their 
    static struct irq_desc bad_irq_desc = { 
    112115asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs) 
    113116{ 
    114117        struct pt_regs *old_regs = set_irq_regs(regs); 
     118        unsigned long us; 
    115119 
    116120        irq_enter(); 
    117121 
     122        us = s3c2410_gettimeoffset(); 
     123 
    118124        /* 
    119125         * Some hardware gives randomly wrong interrupts.  Rather 
    120126         * than crashing, do something sensible. 
    asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs) 
    124130        else 
    125131                generic_handle_irq(irq); 
    126132 
     133        us = s3c2410_gettimeoffset() - us; 
     134 
     135        if (iblock_limit && us > iblock_limit && us < 10000000) 
     136                printk(KERN_ERR "asm_do_IRQ(%u): %lu us\n", irq, us); 
     137 
    127138        /* AT91 specific workaround */ 
    128139        irq_finish(irq); 
    129140