From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753401AbdEJO3c (ORCPT ); Wed, 10 May 2017 10:29:32 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46716 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752960AbdEJO33 (ORCPT ); Wed, 10 May 2017 10:29:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7056D6029E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kgunda@codeaurora.org From: Kiran Gunda To: Kiran Gunda , Christophe JAILLET , Greg Kroah-Hartman , Abhijeet Dharmapurikar , linux-kernel@vger.kernel.org Cc: Timur Tabi , 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 Message-Id: <1494426343-6431-9-git-send-email-kgunda@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1494426343-6431-1-git-send-email-kgunda@codeaurora.org> References: <1494426343-6431-1-git-send-email-kgunda@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Abhijeet Dharmapurikar 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 Signed-off-by: Kiran Gunda --- 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