Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp999575iol; Sun, 12 Jun 2022 03:26:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgMGrrLP0l7YxmAlv4HJNo1WAbI/A4ocRZT1LwGYp0YxbUGRsY3e/wWZwOe0NLVXzKmRqL X-Received: by 2002:aa7:82ca:0:b0:51b:cf43:d00a with SMTP id f10-20020aa782ca000000b0051bcf43d00amr51766877pfn.58.1655029584087; Sun, 12 Jun 2022 03:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655029584; cv=none; d=google.com; s=arc-20160816; b=muV3zIRk1jair0V4aCHz5VPegDY8Z1CzHvOu2esCjlyXuRF5yFLGi1wwqkojCGEIEY SvIf7Y8s0AKMsImKOQ1/A9ZVQ3hljdfPwLM055/3Q0RcEBetzTaIsjp738yXF70vng5G xCEdRFRaC8PZE6lrg2pDl/ceJxoKarqWr3maZJiwTqfQscwOdyyPQnWxXjCB92jk6D/Y 8l9dlHS8RqSgI/aR6F1/K9eQv1qxqyafOa3jrZCVrY5zk3JIcGxY636yxALaAZfljUof BnCvSxpQkdji2Y3PZst7DHacZTbrUaOys0ARug8WwtoPjdBy7FdpWD80Q3N2Qh/cVqwH rdgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=g3rY4bpEO25fMFkUyVjEe7VfSZehXBwtx/lekwobvxU=; b=tySnq3AwBs5bbxaUgCHRhlVWgilyvzzOBaHwN1WZknq2vVKe4slH8Kgo/IWtt1e06u UqAf3x6q5In5OUvV444S46/sI27DIbjx9Gj3s0PdU8+Kq9pfsuJWlf4Hu8FNLiluQ7oj pCp++3wJdqQYivQwNgHnwOxJH0C5bFsmDoS5MCdbNqdC6Moc795DHJSyAfa2DXKX7j+M gWY6WW3BB/TRtd5pb3SMQstIlOoGEvCjXCI6E0ja++lLm0unIAGKmioRZOY+qp00kgFL hG//s+cJ8VYHyTqvWmHAYrKopBmN7CbzT4BJs+gk0gWttKYFajQAsJtJcRE0BI79Z8Vp jOLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=AbMKK3UF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a17090a644100b001d934c0fbfesi5238163pjm.77.2022.06.12.03.26.03; Sun, 12 Jun 2022 03:26:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=AbMKK3UF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233830AbiFLDZ1 (ORCPT + 99 others); Sat, 11 Jun 2022 23:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233328AbiFLDZR (ORCPT ); Sat, 11 Jun 2022 23:25:17 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2C4C66C9E; Sat, 11 Jun 2022 20:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1655004316; x=1686540316; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=g3rY4bpEO25fMFkUyVjEe7VfSZehXBwtx/lekwobvxU=; b=AbMKK3UFdRs/iC3tBMAXkHOuHnm/zJr0wVFMdCYPOFe5rbfL+eqHA+tc 4xEbjEA/54fzgZSmHolBx/92YFPIWDyIyyHpfTO6N49VaklP/vwpCDw0X i8XW+3gYwJg+6mBQ78cdUoLZ2DuDsMKk932eIbkqAjUH1P0ySxKT8IO1H 4=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 11 Jun 2022 20:25:16 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2022 20:25:16 -0700 Received: from nalasex01c.na.qualcomm.com (10.47.97.35) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sat, 11 Jun 2022 20:25:15 -0700 Received: from fenglinw-gv.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sat, 11 Jun 2022 20:25:13 -0700 From: Fenglin Wu To: , , CC: , , , , Subject: [RESEND PATCH v6 02/10] spmi: pmic-arb: handle spurious interrupt Date: Sun, 12 Jun 2022 11:24:38 +0800 Message-ID: <1655004286-11493-3-git-send-email-quic_fenglinw@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1655004286-11493-1-git-send-email-quic_fenglinw@quicinc.com> References: <1655004286-11493-1-git-send-email-quic_fenglinw@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call handle_bad_irq() when the summary interrupt is fired spuriously. Signed-off-by: Fenglin Wu --- drivers/spmi/spmi-pmic-arb.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index 5a99723..719bd73 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -605,10 +605,11 @@ static void cleanup_irq(struct spmi_pmic_arb *pmic_arb, u16 apid, int id) irq_mask, ppid); } -static void periph_interrupt(struct spmi_pmic_arb *pmic_arb, u16 apid) +static int periph_interrupt(struct spmi_pmic_arb *pmic_arb, u16 apid) { unsigned int irq; u32 status, id; + int handled = 0; u8 sid = (pmic_arb->apid_data[apid].ppid >> 8) & 0xF; u8 per = pmic_arb->apid_data[apid].ppid & 0xFF; @@ -623,7 +624,10 @@ static void periph_interrupt(struct spmi_pmic_arb *pmic_arb, u16 apid) continue; } generic_handle_irq(irq); + handled++; } + + return handled; } static void pmic_arb_chained_irq(struct irq_desc *desc) @@ -634,7 +638,7 @@ static void pmic_arb_chained_irq(struct irq_desc *desc) int first = pmic_arb->min_apid >> 5; int last = pmic_arb->max_apid >> 5; u8 ee = pmic_arb->ee; - u32 status, enable; + u32 status, enable, handled = 0; int i, id, apid; chained_irq_enter(chip, desc); @@ -649,10 +653,14 @@ static void pmic_arb_chained_irq(struct irq_desc *desc) enable = readl_relaxed( ver_ops->acc_enable(pmic_arb, apid)); if (enable & SPMI_PIC_ACC_ENABLE_BIT) - periph_interrupt(pmic_arb, apid); + if (periph_interrupt(pmic_arb, apid) != 0) + handled++; } } + if (handled == 0) + handle_bad_irq(desc); + chained_irq_exit(chip, desc); } -- 2.7.4