Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7339465imu; Thu, 31 Jan 2019 08:35:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN7qOYBxAeYv/EJFtiL2jXVNMsqE5rIrhO4HlCmRsI5zxylJ+yKlgCvqqNZETSsFs3a4OG8s X-Received: by 2002:a62:8e19:: with SMTP id k25mr35466131pfe.185.1548952539791; Thu, 31 Jan 2019 08:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548952539; cv=none; d=google.com; s=arc-20160816; b=iigiu6s4Y86X01hSEnZhEDnYa5J+2tabrwhEB8GIQwVpkwk6vJYxgOGjQQKV//B6C5 GS2BseRLpZ+FW5tHtlji6ILMva6zVw3kM4gYZhYARrK2QKyfKjazM0cXxggAulahIHm0 Q79P78xuvCwHaliJqW4NrwJHxFfI94W/uJ97/tHSzADuMDYHKGMXH3yNwFn9C/wiLBzZ hF7LNcXdkhCyD/c7+x9ZWv+t5fsCe1U8CsGPTLAYQfnHPOzaTCApyGpq9fhjXRkXYJ/i vY4YC/Yam8Ha69XKmyjMtH9aBEI5+1DhBj14yEgO9jO91ebImLVi6ysl4y38tBWlN+kF 4qhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature; bh=RRsMytT98vj6iPYj0p3WXO9s6xARzNG15C1ZzTjZH9M=; b=feuPhApZvE4wAOacMHqhdUl7X3BHuHEkD3l4e3heOSVZxirOkuYQQmsiwOOIG7HgER DGgncV3Z98Cb2dyUQ2vrUVa3n10ft9vBPHsjxO7jzGpR6+GTFG4rn5UFx0l0riBBw9XH 1WBqHOfwlTn1nEVNjc0EnRVEdmzfiBuer7crt2JU3j4cRjqu8bDcIwu5MPEUUrWIj5ut 5Dqo4YkLk8iizZ6V78byd+5ioD2DTLj/Mt9LWpUrvR6SZG/4Id3t6uF35T0nkiKZ+H7Z e3DsgcdLc4NGUFy0P/V5lTwrLFAghCequt9M4pErDfSoi1PmEALVFmgiD6Jd5wUT+/TY tRUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=aeDWhHns; dkim=pass header.i=@codeaurora.org header.s=default header.b=j3p7wxhV; 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 n15si4673581pgk.27.2019.01.31.08.35.24; Thu, 31 Jan 2019 08:35:39 -0800 (PST) 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=aeDWhHns; dkim=pass header.i=@codeaurora.org header.s=default header.b=j3p7wxhV; 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 S2388602AbfAaQek (ORCPT + 99 others); Thu, 31 Jan 2019 11:34:40 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:37392 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388304AbfAaQek (ORCPT ); Thu, 31 Jan 2019 11:34:40 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DD47D609CA; Thu, 31 Jan 2019 16:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548952478; bh=TgSG6OLYr1Q8S+PQ4cO/OWuvT8OqQFjjsmfDy94JTkI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aeDWhHnsHaQuYLWt98ECOGVAvkybapV8tpGe+dhy2w1t97A98nlsmn2TN+aZEqtlb PEPOLDyJRdzf8Tpq2YEhDd2f8WlmI/ARo841FT3D6ZlI747kgWpgVhvYLMqMXDzqWj QohNeAdXhoXPVQrn5xVYIu9vHStW/8aH3adch7DI= 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 autolearn=no autolearn_force=no version=3.4.0 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0D77660A73; Thu, 31 Jan 2019 16:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548952476; bh=TgSG6OLYr1Q8S+PQ4cO/OWuvT8OqQFjjsmfDy94JTkI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j3p7wxhVaH+Tel/TqWj5JvnxBETDFjhT3ME4Vf+6SjBDvVB6+kRhCjqcdJeoIhBw+ k5niEaeNPIalrgwYmzA2tkiYvvpgT960RNE79TmFac9IOrPqNkL18Z24dnACcKiVm6 ds0qb7qCV/g0isReaqBB9xAog8FudENFYCK6H3Nk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0D77660A73 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 Date: Thu, 31 Jan 2019 09:34:35 -0700 From: Lina Iyer To: Stephen Boyd Cc: evgreen@chromium.org, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, rplsssn@codeaurora.org, linux-arm-msm@vger.kernel.org, thierry.reding@gmail.com, bjorn.andersson@linaro.org, dianders@chromium.org, linus.walleij@linaro.org Subject: Re: [PATCH v2 5/8] drivers: pinctrl: msm: setup GPIO irqchip hierarchy Message-ID: <20190131163435.GB6069@codeaurora.org> References: <20190124202205.7940-1-ilina@codeaurora.org> <20190124202205.7940-6-ilina@codeaurora.org> <154888832839.169292.6913084380036629941@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <154888832839.169292.6913084380036629941@swboyd.mtv.corp.google.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 30 2019 at 15:45 -0700, Stephen Boyd wrote: >Quoting Lina Iyer (2019-01-24 12:22:02) >> To allow GPIOs to wakeup the system from suspend or deep idle, the >> wakeup capable GPIOs are setup in hierarchy with interrupts from the >> wakeup-parent irqchip. >> >> In older SoC's, the TLMM will handover detection to the parent irqchip >> and in newer SoC's, the parent irqchip may also be active as well as the >> TLMM and therefore the GPIOs need to be masked at TLMM to avoid >> duplicate interrupts. To enable both these configurations to exist, >> allow the parent irqchip to dictate the TLMM irqchip's behavior when >> masking/unmasking the interrupt. >> >> Co-developed-by: Stephen Boyd >> Signed-off-by: Lina Iyer >> >> --- >> Changes in v2: >> - Fix bug when unmaksing PDC interrupt > >What was the bug? The problem was an incorrect merge (possibly manual), causing the PDC to be not used at all. This is what I had - static void msm_gpio_irq_mask(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct msm_pinctrl *pctrl = gpiochip_get_data(gc); const struct msm_pingroup *g; unsigned long flags; u32 val; g = &pctrl->soc->groups[d->hwirq]; if (d->parent_data) irq_chip_unmask_parent(d); /* Monitored by parent wakeup controller? Keep masked */ if (test_bit(d->hwirq, pctrl->wakeup_masked_irqs)) return; The above unmask_parent() call in an irq_mask() callback was the bug. >Is that why the mask callback in this gpio chip no >longer calls the parent irq chip? We should keep calling the parent >irqchip from what I can tell. Otherwise, we may never mask the irq at >the PDC and only mask it at the GPIO level, which may not even care >about it if it's being monitored by the PDC. > >This causes me to get a bunch of interrupts on my touchscreen when I >touch it once vs. only a handful (like 4) when I fix it with the below >patch: > Hmm... I did not see an issue in my local testing :( Thanks for the fix. >Can you fold it in? > Yes, I will fold it in and send a rev out with the fix. Thanks, Lina >diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c >index dd72ec8fb8db..9b45219893bd 100644 >--- a/drivers/pinctrl/qcom/pinctrl-msm.c >+++ b/drivers/pinctrl/qcom/pinctrl-msm.c >@@ -682,6 +682,9 @@ static void msm_gpio_irq_mask(struct irq_data *d) > clear_bit(d->hwirq, pctrl->enabled_irqs); > > raw_spin_unlock_irqrestore(&pctrl->lock, flags); >+ >+ if (d->parent_data) >+ irq_chip_mask_parent(d); > } > > static void msm_gpio_irq_unmask(struct irq_data *d)