From patchwork Wed May 10 14:25:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiran Gunda X-Patchwork-Id: 9719965 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 795B3603F8 for ; Wed, 10 May 2017 14:30:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B87128607 for ; Wed, 10 May 2017 14:30:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 601062861A; Wed, 10 May 2017 14:30:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 609F228610 for ; Wed, 10 May 2017 14:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753224AbdEJO3b (ORCPT ); Wed, 10 May 2017 10:29:31 -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 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EFAA46029E; Wed, 10 May 2017 14:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1494426564; bh=jgHZ4+TVFUHhlv4aCc1AFUfbOXO65THJvyhM9XaiMkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dAJ+vVeREOhoIYLfrP0k4ZCkOLcYtGswgblIExe7skAOm3s9tkB/WyG+1Q7/rZ1FZ 6fClyfheOVS7uNt5OPUUa/6Yqpk6Uo0scsc+L6G5xhcCXJBdQT80hWWj5Pp3HDqHTv UPKdXKuFVn9KIjMgLMw4kIWdFYF1PlsZylwDEKbo= Received: from kgunda-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kgunda@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7056D6029E; Wed, 10 May 2017 14:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1494426563; bh=jgHZ4+TVFUHhlv4aCc1AFUfbOXO65THJvyhM9XaiMkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GR5MJZTSjEu6jTlXPNpNxoX+14QYa8YJh3yB7DMQeoPfrX6E1KWPwBF1yypPt4Jjm sA0/Lio5xvBqfxlKgcnzIic/qZaKW1Oo0Lk6Fuqa+vZCliJ55xcUDx09Ll8dhAACJy d1pwaa+2yzwDCsXuHFKUHpZLLliMHslstAhPwe6o= 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); } }