mfd: pm8xxx-irq: mask non requested interrupt
When a non requested interrupt triggers, the genirq ends up calling
mask or mask_ack callback. This callback is expected to mask that
interrupt so it doesn't trigger us further.
There is a bug in the pm8xxx-irq driver where config[] entry for an
unrequested irq remains empty. So the mask or the mask_ack callback
ends up masking 0th interrupt.
Fix the mask and mask_ack callback to check if config[] is empty, if
so fill it in right then and mask the irq.
Change-Id: I85d3bfff92c52a1c3eb8123a9c3757660e20fac6
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/drivers/mfd/pm8xxx-irq.c b/drivers/mfd/pm8xxx-irq.c
index 5864b85..14c9ec4 100644
--- a/drivers/mfd/pm8xxx-irq.c
+++ b/drivers/mfd/pm8xxx-irq.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -221,6 +221,11 @@
master = block / 8;
irq_bit = pmirq % 8;
+ if (chip->config[pmirq] == 0) {
+ pr_warn("masking rouge irq=%d pmirq=%d\n", d->irq, pmirq);
+ chip->config[pmirq] = irq_bit << PM_IRQF_BITS_SHIFT;
+ }
+
config = chip->config[pmirq] | PM_IRQF_MASK_ALL;
pm8xxx_write_config_irq(chip, block, config);
}
@@ -236,6 +241,11 @@
master = block / 8;
irq_bit = pmirq % 8;
+ if (chip->config[pmirq] == 0) {
+ pr_warn("mask acking rouge irq=%d pmirq=%d\n", d->irq, pmirq);
+ chip->config[pmirq] = irq_bit << PM_IRQF_BITS_SHIFT;
+ }
+
config = chip->config[pmirq] | PM_IRQF_MASK_ALL | PM_IRQF_CLR;
pm8xxx_write_config_irq(chip, block, config);
}