Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1968381ybe; Sat, 14 Sep 2019 05:25:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIoIHcUOh0xeVvsbK6xNFB3W9SDWvf8mUqza1JqcgYe5WAlP15gn4H+ATWvSWgYcDyysS/ X-Received: by 2002:a17:906:80cd:: with SMTP id a13mr44174439ejx.155.1568463939924; Sat, 14 Sep 2019 05:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568463939; cv=none; d=google.com; s=arc-20160816; b=HarU2Vky55H1xEqaNVwdpoktAuVUawKoX86HWRN8h06/aB5Ob8npGKT9opZVJ3RCSu j23hp3N4dX30Oxo5ltkRPxBL5C7Ec/BJv5UmU9YU/3I67auOYxCNlMUMPgUmDS5uZ2mE vbzbg7EPXnP3vQH/I5X/uwXHgM5RvlPvV61ZnPwQ7NOPz3k7ftVkn3y7SKhIqLQQtF3Y G2pmBwnusr7ACEdWsZqJiTIwF0yA6RaF+31d8ZXD2SyVKZPouFKCIBWTqmsD6gAO6J+z zGoI6aybL7JNt8oMF+qIu/3S25eVZQ6Y6yGV5OOofKq7o69QNb1jK2R98zS4bW+NiYZl bxmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature; bh=CD/zu0XaNYS7EofLVg4MwLVOWDsuZw7Hm/EuAdG9ebc=; b=dbFCbUU4+H1gZWxiiDsEacEecFxPL6Tsvdia4Yxqf8HG0Se91RLZhXIADkmsqOrGdy T9vcQgh0Y1pLyQv5FMos6pss5I4EnAf8mlGL2Bqt2DHIM2CgIiZfIUmid/E0OChlYIJU NZitf5azafknr9XYr7Fh9B9VrJe/1DE9sSLylvSWPUKMOWTBpOJ1PN7z/mKzvBMbkb5B SGqi34cUb2bvhvLDDQ5hwcqLpmOMPwXTTQ3mTOxJnWKyRxOXG58c9tKWj/nU5s7N+Z7m 2+s/yHaskYfWog/3KXVAoE8yDuDs0UUP0iqcZrAmUnaZVaxCFNIAHkiLRvW+080SXUPc xY9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=d6lpwxSY; dkim=pass header.i=@codeaurora.org header.s=default header.b="II/NOksb"; 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 e11si448800ejr.383.2019.09.14.05.25.15; Sat, 14 Sep 2019 05:25:39 -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=d6lpwxSY; dkim=pass header.i=@codeaurora.org header.s=default header.b="II/NOksb"; 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 S2390308AbfIMV7r (ORCPT + 99 others); Fri, 13 Sep 2019 17:59:47 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59584 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390018AbfIMV7q (ORCPT ); Fri, 13 Sep 2019 17:59:46 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 01543607C6; Fri, 13 Sep 2019 21:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1568411985; bh=mJ6ERleIUVuaUxsJYCNgiuvwDk4I+BHBd01lZAWccGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d6lpwxSYc+zd5X0IcJDdYCozHY4WhBW/Tx/zkIZz/rddzXOY0Xqhy4tR88hnN3T42 utY4T9CXiXBVsh9v6ZjKUH6skna3erY1mbtOGTrGRMbXPnv358SsWM3QuIiky8KBdU dk4SCxceuz+aol45an39SMkUzdG5MtmOzjOERe+c= 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 66F3E607C6; Fri, 13 Sep 2019 21:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1568411984; bh=mJ6ERleIUVuaUxsJYCNgiuvwDk4I+BHBd01lZAWccGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=II/NOksbYtlYfHVAXo4v22YeoSLlO1vjfyL5pBMTAH2FFZ4O1nI8UHl6Yl6vtIa/1 O1FmWfkjsrGVldlxZ5aKi0pBUcdkbOzHZdnBMYdPc0pLp00i48bkgn6zB/Ziha8QfV o0O0qG10yoU8DwtuL+VFVBawXwo99vbs9rBxTC08= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 66F3E607C6 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, maz@kernel.org, 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, Lina Iyer Subject: [PATCH RFC v2 03/14] drivers: irqchip: pdc: Do not toggle IRQ_ENABLE during mask/unmask Date: Fri, 13 Sep 2019 15:59:11 -0600 Message-Id: <1568411962-1022-4-git-send-email-ilina@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568411962-1022-1-git-send-email-ilina@codeaurora.org> References: <1568411962-1022-1-git-send-email-ilina@codeaurora.org> 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 b230794..5eef5ea 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