diff options
author | Abhijeet Dharmapurikar <adharmap@codeaurora.org> | 2017-05-10 19:55:39 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-03 19:05:47 +0900 |
commit | 472eaf8bedbbedc4df5f7007d1eceb4624a78afa (patch) | |
tree | f95a6ee70f7247c75a4dac216159f22366c1eb69 /drivers/spmi | |
parent | 5f9b2ea3da8cf079e22cbb0fc2ed1b9034f7dd42 (diff) | |
download | linux-472eaf8bedbbedc4df5f7007d1eceb4624a78afa.tar.gz linux-472eaf8bedbbedc4df5f7007d1eceb4624a78afa.tar.bz2 linux-472eaf8bedbbedc4df5f7007d1eceb4624a78afa.zip |
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.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/spmi')
-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 ad344916493c..f8638faaac9d 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -536,8 +536,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); @@ -547,7 +547,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); } } |