aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorSascha Wessel <wessel@nefkom.net>2009-02-11 08:41:08 +0000
committerAndy Green <agreen@octopus.localdomain>2009-02-11 08:41:08 +0000
commit8ae43c9cb47a1bc7e2912e74a3abf263d6efc62f (patch)
treeef76b3727caade8f38d6be3839dad0725599cf38 /arch/arm/kernel
parent3237030220f974f89b706cb9f6284c8f36a5a5d9 (diff)
interrupt-handlin-time-detector.patch
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/iblock.c6
-rw-r--r--arch/arm/kernel/irq.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/arch/arm/kernel/iblock.c b/arch/arm/kernel/iblock.c
index 87b98048922..48632738b5f 100644
--- a/arch/arm/kernel/iblock.c
+++ b/arch/arm/kernel/iblock.c
@@ -29,7 +29,7 @@ unsigned long s3c2410_gettimeoffset(void);
static unsigned long iblock_t0;
-static int iblock_limit;
+int iblock_limit;
static int iblock_max;
@@ -64,9 +64,9 @@ void iblock_end(void)
return;
if (us < iblock_limit)
return;
- iblock_limit = 0;
+// iblock_limit = 0;
printk(KERN_ERR "interrupts were disabled for %lu us !\n", us);
- WARN_ON(1);
+// WARN_ON(1);
}
EXPORT_SYMBOL_GPL(iblock_end);
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 7141cee1fab..573d546b62e 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -104,6 +104,9 @@ static struct irq_desc bad_irq_desc = {
.lock = SPIN_LOCK_UNLOCKED
};
+extern int iblock_limit;
+unsigned long s3c2410_gettimeoffset(void);
+
/*
* do_IRQ handles all hardware IRQ's. Decoded IRQs should not
* come via this function. Instead, they should provide their
@@ -112,9 +115,12 @@ static struct irq_desc bad_irq_desc = {
asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
+ unsigned long us;
irq_enter();
+ us = s3c2410_gettimeoffset();
+
/*
* Some hardware gives randomly wrong interrupts. Rather
* than crashing, do something sensible.
@@ -124,6 +130,11 @@ asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
else
generic_handle_irq(irq);
+ us = s3c2410_gettimeoffset() - us;
+
+ if (iblock_limit && us > iblock_limit && us < 10000000)
+ printk(KERN_ERR "asm_do_IRQ(%u): %lu us\n", irq, us);
+
/* AT91 specific workaround */
irq_finish(irq);