diff options
author | Abhijeet Dharmapurikar <adharmap@codeaurora.org> | 2016-04-27 20:39:46 -0700 |
---|---|---|
committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-05-10 13:20:11 -0700 |
commit | e8656817cadc02953e8953167151ac8bd43ce108 (patch) | |
tree | 737119765e74fbb8882962e40b9809397796a566 | |
parent | a071656691562a72c68f18c7d102fa1b069f096e (diff) |
spmi-pmic-arb: check apid enabled before calling the handler
The driver currently invokes the apid handler (periph_handler()) once it
sees that the summary status bit for that apid is set.
However the hardware is designed to set that bit even if the apid
interrupts are disabled. The driver should check whether the apid is
indeed enabled before calling the apid handler.
CRs-Fixed: 1001770
Change-Id: I1415c41ec99ca4b767392ea3443691760f967953
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
-rw-r--r-- | drivers/spmi/spmi-pmic-arb.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index 3a266d192e92..f98eabeb382c 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -543,8 +543,8 @@ static void pmic_arb_chained_irq(struct irq_desc *desc) void __iomem *intr = pa->intr; int first = pa->min_apid >> 5; int last = pa->max_apid >> 5; - u32 status; - int i, id; + u32 status, enable; + int i, id, apid; chained_irq_enter(chip, desc); @@ -554,7 +554,11 @@ static void pmic_arb_chained_irq(struct irq_desc *desc) while (status) { id = ffs(status) - 1; status &= ~BIT(id); - periph_interrupt(pa, id + i * 32); + apid = id + i * 32; + enable = readl_relaxed(intr + + pa->ver_ops->acc_enable(apid)); + if (enable & SPMI_PIC_ACC_ENABLE_BIT) + periph_interrupt(pa, apid); } } |