Commit 885ae16a authored by Russell King's avatar Russell King

[ARM] Fix ARM IRQ probe code

- Add semaphore to prevent simultaneous probe_irq_on() callers.
- Add probe_irq_mask() for yenta.c
parent e6fb2e60
...@@ -127,6 +127,7 @@ EXPORT_SYMBOL(__bad_xchg); ...@@ -127,6 +127,7 @@ EXPORT_SYMBOL(__bad_xchg);
EXPORT_SYMBOL(__readwrite_bug); EXPORT_SYMBOL(__readwrite_bug);
EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(probe_irq_mask);
EXPORT_SYMBOL(set_irq_type); EXPORT_SYMBOL(set_irq_type);
EXPORT_SYMBOL(pm_idle); EXPORT_SYMBOL(pm_idle);
EXPORT_SYMBOL(pm_power_off); EXPORT_SYMBOL(pm_power_off);
......
...@@ -606,6 +606,8 @@ void free_irq(unsigned int irq, void *dev_id) ...@@ -606,6 +606,8 @@ void free_irq(unsigned int irq, void *dev_id)
} }
} }
static DECLARE_MUTEX(probe_sem);
/* Start the interrupt probing. Unlike other architectures, /* Start the interrupt probing. Unlike other architectures,
* we don't return a mask of interrupts from probe_irq_on, * we don't return a mask of interrupts from probe_irq_on,
* but return the number of interrupts enabled for the probe. * but return the number of interrupts enabled for the probe.
...@@ -617,6 +619,8 @@ unsigned long probe_irq_on(void) ...@@ -617,6 +619,8 @@ unsigned long probe_irq_on(void)
unsigned int i, irqs = 0; unsigned int i, irqs = 0;
unsigned long delay; unsigned long delay;
down(&probe_sem);
/* /*
* first snaffle up any unassigned but * first snaffle up any unassigned but
* probe-able interrupts * probe-able interrupts
...@@ -656,6 +660,21 @@ unsigned long probe_irq_on(void) ...@@ -656,6 +660,21 @@ unsigned long probe_irq_on(void)
return irqs; return irqs;
} }
unsigned int probe_irq_mask(unsigned long irqs)
{
unsigned int mask = 0, i;
spin_lock_irq(&irq_controller_lock);
for(i = 0; i < 16 && i < NR_IRQS; i++)
if (irq_desc[i].probing && irq_desc[i].triggered)
mask |= 1 << i;
spin_unlock_irq(&irq_controller_lock);
up(&probe_sem);
return mask;
}
/* /*
* Possible return values: * Possible return values:
* >= 0 - interrupt number * >= 0 - interrupt number
...@@ -687,6 +706,8 @@ int probe_irq_off(unsigned long irqs) ...@@ -687,6 +706,8 @@ int probe_irq_off(unsigned long irqs)
out: out:
spin_unlock_irq(&irq_controller_lock); spin_unlock_irq(&irq_controller_lock);
up(&probe_sem);
return irq_found; return irq_found;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment