Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2703986imm; Mon, 24 Sep 2018 08:36:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV61TKevSww+DLOBOy5nLegOyATjvJr8PL4r6zKXIh0uQ3eCWDOWVZmrBEJzpCWFU9AZptau+ X-Received: by 2002:a63:7f06:: with SMTP id a6-v6mr10102774pgd.296.1537803413486; Mon, 24 Sep 2018 08:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537803413; cv=none; d=google.com; s=arc-20160816; b=N9E+xwaalpudq4erA6FP0ij87Llwzyp8J8wvqq0Fdh0xEgBTodykAQOmKY645O2loj s+E55VEiNv0i2tAoENP8z73TZ4Q8jUVq1EDEnF1jC/sxXwS2H/JvtI/PHetLJxz9Q63W 75650RcfNS5lv1QbysBqqa5kzHA4kirEMpyU4BMxEuLmDwV/gHRH8HkaTK87113rSME7 i4oHOIWE13Rk7d6aO+RzDMrr8KyOCrzNyW5C7nwCALevpFQSwOShQHeok4iMFhhgBoee cFQciqi3VBGzKhDOU6Yr7BPZaQYmg1m/AznomQKIzOaf3de/+C8MHX6WZ88nnJ+pwns7 9P+A== 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=jps31CrxotMue3PlhhVT39QC6TvZtLvLAHHLn6kbkVo=; b=lFVeX/Y01EMrI0qC7iAfP8PF852z9bkUxqmwyLkWBaLhKC4/K+hNy4dF62PDNSFqKd +jZy/H/gx1lUclUyDEkXeLzY2Ndhcqv9BNnpzTiMZZT5nu9hHJ7PsMySE7Pme2EcCngX YsqopEzYCg3bg1HtQxEczjqqermDxvh9LzkjG0HAI1w8rGLTYiraOty1b1TDsmRHM7y/ O/lHwA7eMdbgVR3q1ImUZUKdGutp8Ri61ZTDT+2/j1p0+Jr6KlLD0vdXf0XQw7uwD5Oh bTq04u0b9g9yGFYmynB6IbkkgiJpyImi0tmZMd5XvYW2yan7BrWbWdNYwKN08TKLTklT 70sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="R/C7Fyrw"; dkim=pass header.i=@codeaurora.org header.s=default header.b=NjRSj+lI; 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 u9-v6si4497874plq.481.2018.09.24.08.36.37; Mon, 24 Sep 2018 08:36: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="R/C7Fyrw"; dkim=pass header.i=@codeaurora.org header.s=default header.b=NjRSj+lI; 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 S1730369AbeIXVi2 (ORCPT + 99 others); Mon, 24 Sep 2018 17:38:28 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38470 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727770AbeIXVi2 (ORCPT ); Mon, 24 Sep 2018 17:38:28 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8589360275; Mon, 24 Sep 2018 15:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537803343; bh=2/odgQNhiVZLh5asPkZ0bd8jbF9pbwHTX22kJbUPikI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=R/C7FyrwUZrUsExUo5T5CMsoYlt2Tdtj+B/Kjct1ytXueF519KDr/gp86Lmk5bDlb 7bZxWCDbQQTaPD16Kclp2knpwxR4V/OFItsdaV0YtTpMOy6c6Lr1MF5uS6VP+lXGlU FOvTisBKN6Mr4ECrD7ztqb6eD9020jMZn5fPVYoU= 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.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID 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 9222E60214; Mon, 24 Sep 2018 15:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537803342; bh=2/odgQNhiVZLh5asPkZ0bd8jbF9pbwHTX22kJbUPikI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NjRSj+lIiipzhESl9vkFoOWups4TJTQXqHk3PDhSi7j2nsDvAT32a9yWucUvJnBX/ 76UcesjjajUmLccA69G0FYhuvgY0jNEOCGinbFfYYZbPbmm7EzrZXL6lMyN5WdcT6s z1Qk1+AYkQsETO/Se3knI+KBTox9O7ZJOomiuruY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9222E60214 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: Mon, 24 Sep 2018 09:35:41 -0600 From: Lina Iyer To: Marc Zyngier Cc: bjorn.andersson@linaro.org, sboyd@kernel.org, evgreen@chromium.org, linus.walleij@linaro.org, rplsssn@codeaurora.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, rnayak@codeaurora.org, devicetree@vger.kernel.org, andy.gross@linaro.org, dianders@chromium.org Subject: Re: [PATCH v3 3/5] drivers: pinctrl: msm: enable PDC interrupt only during suspend Message-ID: <20180924153541.GJ17420@codeaurora.org> References: <20180904211810.5506-1-ilina@codeaurora.org> <20180904211810.5506-4-ilina@codeaurora.org> <868t3twl64.wl-marc.zyngier@arm.com> <20180922170909.GI17420@codeaurora.org> <867ejcwnn7.wl-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <867ejcwnn7.wl-marc.zyngier@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 23 2018 at 03:48 -0600, Marc Zyngier wrote: >On Sat, 22 Sep 2018 18:09:09 +0100, >Lina Iyer wrote: >> >> On Sat, Sep 22 2018 at 10:29 -0600, Marc Zyngier wrote: >> > Hi Lina, >> > >> > On Tue, 04 Sep 2018 22:18:08 +0100, >> > Lina Iyer wrote: >> Also, I am exploring an option that was suggested by Stephen [1] to just >> use the PDC interrupt as a parent of the GPIO IRQ and use a different >> irqchip for the PDC interrupt. I ran into some issue with accessing >> irqchip and irqdata of the PDC interrupt, since the irqchip was not in >> hierarchy with the GPIO's irqchip. I haven't been able to find time to >> resolve the issue that the set_parent_ functions, because of the >> hierarchy. >> >> Essentially, we have two different mechanisms for GPIO IRQs based on >> whether they can be woken up by the PDC interrupt. >> >> GPIO-IRQ --> PDC --> GIC >> >> GPIO-IRQ --> TLMM SUMMARY --> GIC >> >> Do you think the idea is feasible? It would avoid doing all this >> enable/disable at every suspend and even during idle, when the TLMM >> could be powered off. > >[me tries to page it all in again] > >You could have the PDC as part of the GPIO hierarchy: > > GPIO -> PDC -> TLMM -> GIC > The PDC irqchip's parent is the GIC as set up in drivers/irqchip/qcom-pdc.c. Wouldn't that conflict with the established hierarchy? >and always configure the PDC as a wake-up source. I just wonder if you >can do that without setting up a parallel hierarchy between the PDC >and the GIC. We already have similar things in the tree (see OMAP's >wakeupgen), and it may be worth having a look. Sure, will take a look. >The lack of interrupt >replaying on the PDC is quite annoying (I have much stronger words in >mind though), and I'm not sure we can easily fix that one without this >parallel interrupt hack (you need something to inject edge interrupts >in the TLMM). > The PDC replays the intterupt at the GIC, not the at the TLMM. So the hierachy you recommended may not work as well here. >> >> >> >> + disable_irq(irqd->irq); >> >> + enable_irq(irq); >> >> + } >> >> + } >> > >> > Given that you're changing in_suspend and parsing the bitmap, >> > shouldn't take the pdc spinlock? >> > >> Since we are the the only CPU running and suspend/resume (and even idle) >> would be serialized I didn't see a reason for needing a lock. > >In that case, what is the purpose of 'in_suspend' if >msm_gpio_irq_set_wake cannot happen during the suspend/resume phases? >It all seems a bit inconsistent. > Well the disable_irq_wake that I call here, calls into the set_wake callbacks. Hence the flag to indicate that we should ignore the PDC interrupt configuration at that time. Let me see if I need to disable the disable_irq_wake at all. Thanks, Lina