Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2681629ybl; Thu, 29 Aug 2019 11:23:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyP19rzSg6UkKbt8XpTMFAONEyy9H5d1tmRd1ahbTZARY06eIoCxFK/YE9MzVIHE/tzExsW X-Received: by 2002:a65:52ca:: with SMTP id z10mr9883695pgp.424.1567103033555; Thu, 29 Aug 2019 11:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567103033; cv=none; d=google.com; s=arc-20160816; b=RxZA+TIRGdCVYquN8GkMDv5r3/shVW/Db4fNcqO0MaZss8UMg4g2xLb/j6e1fm/xIk yoB3wijxCW2DXlPLYyG00denEqc3yFdkmObhtfnHKGDNWZW+6f/Q+eGhRAr9tx17iwqs sMm1bouoRMAA++A3O4xygz2fasg8DB3P32kNJ9ymI/7BbJMUlNi9K2qR8RtshLhTuV4H HoZzUljfVe8taU97UEoJLCAzfwUZex0+KZD0X4JUN7kCLR9woWxe+GXdq4JxS54IjTFl Ppztyvh60QMvftg3+anZgpxX3DLYr1g6RhxlEYYD7C2CtIGOwS7+W9pOU/21eNv5Pkc3 xApg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=S62+tan0uO2Q7ZXtZEjH+Jol98BMchLjvnbBShMXaMg=; b=jW5oDEG+860vtAsU8hKQzAzGxc+ORJVkgsphJfohq1OX0KCWhXBLFOqmJsw0OAJ9dZ cBuEujqnN2jHnfq6siebF4odOg2YtGGZWX/UltQc2ehKs9fE3YGKsew3r4sC4uxFDXC9 k4TrRbsdaXUUq2vBr5R/qU7LlEBrGcUepe2ZELdIlLzV4SzqGkl+LmDeo2R02NASnZsR TVGgDdPVBOTv5YJRczdf7wd4ru7HVAoW/sLMcBMGcdeRukUcA3C8SA0uyMBTyQI5/R6Z SBZ0ZSsK+CUR4vcFyqM42PI0SIkHqsYNuYFSabpvc3vMHjiNRtszdr4DIBsMEB2E4FpD PFUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VtycVrSA; dkim=pass header.i=@codeaurora.org header.s=default header.b=RPMpETOq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si1507303plt.277.2019.08.29.11.23.37; Thu, 29 Aug 2019 11:23:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VtycVrSA; dkim=pass header.i=@codeaurora.org header.s=default header.b=RPMpETOq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729939AbfH2SWt (ORCPT + 99 others); Thu, 29 Aug 2019 14:22:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53514 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728700AbfH2SWq (ORCPT ); Thu, 29 Aug 2019 14:22:46 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 328F267898; Thu, 29 Aug 2019 18:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1567102965; bh=FeFaJUoDeHdLOh2OaUz0TWmkbjPXVH4svhWA764YwBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VtycVrSAdkukL9EXA/Nj5URdtARJbT4f2tnn+5EZUFMr7WSmXL+rlzSDC7/jZnW6q PmWt/aQspvB6mKZzr31y7ErivhOdwkR7I56EWnlrgWsnZsomBoI5zd1EM3HFSzJTHu f0PgxHacny5Q09voOOsLnIBMP3UelpPagJ5nT1FU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 74C0C6883B; Thu, 29 Aug 2019 18:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1567102334; bh=FeFaJUoDeHdLOh2OaUz0TWmkbjPXVH4svhWA764YwBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RPMpETOqN+zUgVJ54I7e6zv9LkccOW3ztM6OOrzzC/Te80+y/+TfMkno7u2x1u+eW 9yszoW44Ac6fym1pyMb3Kih+1Q9m07v+wgxqjqTMOrnmOAUN37/L63zmhihJPgyE1g WgnM+oaXtWXMPeroZXKYlb2UcWn2urpwfCUkBwQA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 74C0C6883B 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=ilina@codeaurora.org From: Lina Iyer To: swboyd@chromium.org, evgreen@chromium.org, marc.zyngier@arm.com, linus.walleij@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, mkshah@codeaurora.org, linux-gpio@vger.kernel.org, rnayak@codeaurora.org, Lina Iyer Subject: [PATCH RFC 02/14] drivers: irqchip: pdc: Do not toggle IRQ_ENABLE during mask/unmask Date: Thu, 29 Aug 2019 12:11:51 -0600 Message-Id: <20190829181203.2660-3-ilina@codeaurora.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190829181203.2660-1-ilina@codeaurora.org> References: <20190829181203.2660-1-ilina@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When an interrupt is to be serviced, the convention is to mask the interrupt at the chip and unmask after servicing the interrupt. Enabling and disabling the interrupt at the PDC irqchip causes an interrupt storm due to the way dual edge interrupts are handled in hardware. Skip configuring the PDC when the IRQ is masked and unmasked, instead use the irq_enable/irq_disable callbacks to toggle the IRQ_ENABLE register at the PDC. The PDC's IRQ_ENABLE register is only used during the monitoring mode when the system is asleep and is not needed for active mode detection. Signed-off-by: Lina Iyer --- drivers/irqchip/qcom-pdc.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index faa7d61b9d6c..338fae604af5 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -63,15 +63,25 @@ static void pdc_enable_intr(struct irq_data *d, bool on) raw_spin_unlock(&pdc_lock); } -static void qcom_pdc_gic_mask(struct irq_data *d) +static void qcom_pdc_gic_disable(struct irq_data *d) { pdc_enable_intr(d, false); + irq_chip_disable_parent(d); +} + +static void qcom_pdc_gic_enable(struct irq_data *d) +{ + pdc_enable_intr(d, true); + irq_chip_enable_parent(d); +} + +static void qcom_pdc_gic_mask(struct irq_data *d) +{ irq_chip_mask_parent(d); } static void qcom_pdc_gic_unmask(struct irq_data *d) { - pdc_enable_intr(d, true); irq_chip_unmask_parent(d); } @@ -148,6 +158,8 @@ static struct irq_chip qcom_pdc_gic_chip = { .irq_eoi = irq_chip_eoi_parent, .irq_mask = qcom_pdc_gic_mask, .irq_unmask = qcom_pdc_gic_unmask, + .irq_disable = qcom_pdc_gic_disable, + .irq_enable = qcom_pdc_gic_enable, .irq_retrigger = irq_chip_retrigger_hierarchy, .irq_set_type = qcom_pdc_gic_set_type, .flags = IRQCHIP_MASK_ON_SUSPEND | -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project