From patchwork Fri Oct 11 17:21:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 3025441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 19B1D9F243 for ; Fri, 11 Oct 2013 17:27:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1382202BE for ; Fri, 11 Oct 2013 17:27:03 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97C72201BC for ; Fri, 11 Oct 2013 17:27:02 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUgUN-0006QD-DA; Fri, 11 Oct 2013 17:26:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUgPV-0001PP-MJ; Fri, 11 Oct 2013 17:21:57 +0000 Received: from mho-03-ewr.mailhop.org ([204.13.248.66] helo=mho-01-ewr.mailhop.org) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUgPT-0001O8-5E for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2013 17:21:56 +0000 Received: from c-50-131-214-131.hsd1.ca.comcast.net ([50.131.214.131] helo=localhost.localdomain) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1VUgP7-0000e0-5A; Fri, 11 Oct 2013 17:21:33 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.131.214.131 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/NmB8uQuNWSoA9ndf6JMl7 Date: Fri, 11 Oct 2013 10:21:28 -0700 From: Tony Lindgren To: Roger Quadros Subject: Re: [PATCH] pinctrl: single: call pcs_soc->rearm() whenever IRQ mask is changed Message-ID: <20131011172128.GT29913@atomide.com> References: <1381507996-15021-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1381507996-15021-1-git-send-email-rogerq@ti.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131011_132155_366103_485FA3C9 X-CRM114-Status: GOOD ( 19.75 ) X-Spam-Score: -1.9 (-) Cc: grygorii.strashko@ti.com, linus.walleij@linaro.org, peter.ujfalusi@ti.com, haojian.zhuang@linaro.org, bcousson@baylibre.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP * Roger Quadros [131011 09:21]: > On OMAPs the IO ring must be rearmed each time the pad wakeup > configuration is changed. So call pcs_soc->rearm() from > pcs_irq_set(). > > Signed-off-by: Roger Quadros > --- > drivers/pinctrl/pinctrl-single.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c > index c2aada7..1800e47 100644 > --- a/drivers/pinctrl/pinctrl-single.c > +++ b/drivers/pinctrl/pinctrl-single.c > @@ -1604,6 +1604,9 @@ static inline void pcs_irq_set(struct pcs_soc_data *pcs_soc, > pcs->write(mask, pcswi->reg); > raw_spin_unlock(&pcs->lock); > } > + > + if (pcs_soc->rearm) > + pcs_soc->rearm(); > } > > /** > @@ -1626,8 +1629,6 @@ static void pcs_irq_unmask(struct irq_data *d) > struct pcs_soc_data *pcs_soc = irq_data_get_irq_chip_data(d); > > pcs_irq_set(pcs_soc, d->irq, true); > - if (pcs_soc->rearm) > - pcs_soc->rearm(); > } This seems to cause the wake-up interrupts to happen also during runtime for me, which makes the omap3 behave the same way as omap4 already does. However, the concern I have is that we only want the io chain wake-up happen during idle and not during runtime.. So counting on the io chain in your EHCI driver during runtime would require also additional tracking of idle wake up events vs runtime wake-up events somewhere once we have the automatic solution for runtime PM. That is to avoid spurious interrupts during runtime. In any case, since this is an interrupt controller now, we should just follow the Linux standard for interrupt controllers, so if you do a request_irq() on it, you really should get interrupts. I've updated the patch a litte below to also remove the now bogus comment, and to update the description. So considering all that, I suggest that Linus applies the updated fix below into the pinctrl tree after pulling in the the tag I posted for "pinctrl-single-for-linus-for-v3.13-signed". 8< ----------------------- From: Roger Quadros Date: Fri, 11 Oct 2013 19:13:16 +0300 Subject: [PATCH] pinctrl: single: call pcs_soc->rearm() whenever IRQ mask is changed On OMAPs the IO ring must be rearmed each time the pad wakeup configuration is changed. So call pcs_soc->rearm() from pcs_irq_set(). As pinctrl-single is now an interrupt controller in some cases, we should follow the standards and keep the interrupts enabled constantly, and not just for wake-up events. The tracking of runtime vs wake-up interrupts can be handled separately for the automated runtime PM solution when we have it in the future. Signed-off-by: Roger Quadros [tony@atomide.com: removed wrong comment, updated description] Signed-off-by: Tony Lindgren --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1604,6 +1604,9 @@ static inline void pcs_irq_set(struct pcs_soc_data *pcs_soc, pcs->write(mask, pcswi->reg); raw_spin_unlock(&pcs->lock); } + + if (pcs_soc->rearm) + pcs_soc->rearm(); } /** @@ -1626,8 +1629,6 @@ static void pcs_irq_unmask(struct irq_data *d) struct pcs_soc_data *pcs_soc = irq_data_get_irq_chip_data(d); pcs_irq_set(pcs_soc, d->irq, true); - if (pcs_soc->rearm) - pcs_soc->rearm(); } /** @@ -1678,11 +1679,6 @@ static int pcs_irq_handle(struct pcs_soc_data *pcs_soc) } } - /* - * For debugging on omaps, you may want to call pcs_soc->rearm() - * here to see wake-up interrupts during runtime also. - */ - return count; }