Commit 7a93fb37 authored by Fabio Baltieri's avatar Fabio Baltieri Committed by Samuel Ortiz

mfd: ab8500-core: Ignore masked out interrupts

AB8500 asserts LATCH bits for masked out interrupts.  This patch
explicitly masks those out using the cached mask value to prevent
handle_nested_irq() being called for masked IRQ on the same register as
unmasked ones.
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarFabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent d95c7855
...@@ -458,11 +458,7 @@ static void update_latch_offset(u8 *offset, int i) ...@@ -458,11 +458,7 @@ static void update_latch_offset(u8 *offset, int i)
static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
int latch_offset, u8 latch_val) int latch_offset, u8 latch_val)
{ {
int int_bit = __ffs(latch_val); int int_bit, line, i;
int line, i;
do {
int_bit = __ffs(latch_val);
for (i = 0; i < ab8500->mask_size; i++) for (i = 0; i < ab8500->mask_size; i++)
if (ab8500->irq_reg_offset[i] == latch_offset) if (ab8500->irq_reg_offset[i] == latch_offset)
...@@ -474,6 +470,11 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, ...@@ -474,6 +470,11 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
return -ENXIO; return -ENXIO;
} }
/* ignore masked out interrupts */
latch_val &= ~ab8500->mask[i];
while (latch_val) {
int_bit = __ffs(latch_val);
line = (i << 3) + int_bit; line = (i << 3) + int_bit;
latch_val &= ~(1 << int_bit); latch_val &= ~(1 << int_bit);
...@@ -491,7 +492,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, ...@@ -491,7 +492,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
line += 1; line += 1;
handle_nested_irq(ab8500->irq_base + line); handle_nested_irq(ab8500->irq_base + line);
} while (latch_val); }
return 0; return 0;
} }
......
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