From: Kiran Gunda <kgunda@codeaurora.org>
To: Kiran Gunda <kgunda@codeaurora.org>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Abhijeet Dharmapurikar <adharmap@codeaurora.org>,
linux-kernel@vger.kernel.org
Cc: Timur Tabi <timur@codeaurora.org>,
linux-arm-msm@vger.kernel.org, adharmap@quicinc.com,
aghayal@qti.qualcomm.com
Subject: [PATCH 09/11] spmi: pmic-arb: check apid enabled before calling the handler
Date: Wed, 10 May 2017 19:55:39 +0530 [thread overview]
Message-ID: <1494426343-6431-9-git-send-email-kgunda@codeaurora.org> (raw)
In-Reply-To: <1494426343-6431-1-git-send-email-kgunda@codeaurora.org>
From: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
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>
---
drivers/spmi/spmi-pmic-arb.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index ad34491..f8638fa 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);
}
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-05-10 14:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 14:25 [PATCH 01/11] spmi: pmic_arb: block access of invalid read and writes Kiran Gunda
2017-05-10 14:25 ` [PATCH 02/11] spmi: pmic-arb: rename spmi_pmic_arb_dev to spmi_pmic_arb Kiran Gunda
2017-05-10 14:25 ` [PATCH 03/11] spmi: pmic-arb: fix inconsistent use of apid and chan Kiran Gunda
2017-05-10 14:25 ` [PATCH 04/11] spmi: pmic-arb: optimize table lookups Kiran Gunda
2017-05-10 14:25 ` [PATCH 05/11] spmi: pmic-arb: cleanup unrequested irqs Kiran Gunda
2017-05-10 14:25 ` [PATCH 06/11] spmi: pmic-arb: fix missing interrupts Kiran Gunda
2017-05-10 14:25 ` [PATCH 07/11] spmi: pmic-arb: clear the latched status of the interrupt Kiran Gunda
2017-05-10 14:25 ` [PATCH 08/11] spmi: pmic_arb: use appropriate flow handler Kiran Gunda
2017-05-10 14:25 ` Kiran Gunda [this message]
2017-05-10 14:25 ` [PATCH 10/11] spmi: pmic_arb: add support for PMIC bus arbiter v3 Kiran Gunda
2017-05-10 14:25 ` [PATCH 11/11] spmi: spmi-pmic-arb: enable the SPMI interrupt as a wakeup source Kiran Gunda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494426343-6431-9-git-send-email-kgunda@codeaurora.org \
--to=kgunda@codeaurora.org \
--cc=adharmap@codeaurora.org \
--cc=adharmap@quicinc.com \
--cc=aghayal@qti.qualcomm.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=timur@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).