From patchwork Thu Jul 18 08:54:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 2829562 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 401419F9A0 for ; Thu, 18 Jul 2013 09:19:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 078902021B for ; Thu, 18 Jul 2013 09:19:07 +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 908662021A for ; Thu, 18 Jul 2013 09:19:05 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uzk1P-0002ou-K4; Thu, 18 Jul 2013 08:57:14 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uzjzt-0004yp-H2; Thu, 18 Jul 2013 08:55:37 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uzjzq-0004xq-Cd for linux-arm-kernel@lists.infradead.org; Thu, 18 Jul 2013 08:55:35 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6I8tCR6008988; Thu, 18 Jul 2013 03:55:12 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r6I8tC6K017305; Thu, 18 Jul 2013 03:55:12 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Thu, 18 Jul 2013 03:55:12 -0500 Received: from [10.167.145.172] (uglx0174654.ucm2.emeaucm.ext.ti.com [10.167.145.172]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6I8t9gd012027; Thu, 18 Jul 2013 03:55:10 -0500 Message-ID: <51E7AD38.6010108@ti.com> Date: Thu, 18 Jul 2013 11:54:16 +0300 From: Grygorii Strashko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tony Lindgren Subject: Re: [PATCH 3/3] ARM: dts: omap4-sdp: add dynamic pin states for uart3/4 References: <1374061312-25469-1-git-send-email-grygorii.strashko@ti.com> <1374061312-25469-4-git-send-email-grygorii.strashko@ti.com> <20130717153248.GI7656@atomide.com> <51E6C939.40208@ti.com> <20130718080953.GR7656@atomide.com> In-Reply-To: <20130718080953.GR7656@atomide.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130718_045534_612217_DB4CBF6D X-CRM114-Status: GOOD ( 20.03 ) X-Spam-Score: -7.3 (-------) Cc: Kevin Hilman , Stephen Warren , devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, Benoit Cousson , linux-omap@vger.kernel.org, Linus Walleij , 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.5 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 On 07/18/2013 11:09 AM, Tony Lindgren wrote: > * Grygorii Strashko [130717 09:48]: >> Hi, >> >> On 07/17/2013 06:32 PM, Tony Lindgren wrote: >>> * Grygorii Strashko [130717 04:49]: >>>> Add dynamic "active"/"idle" pin states for uart3/4 which will be applied >>>> when uart3/4 state is switched from active to idle and back by Runtime >>>> PM or during system suspend. >>> >>> This is good for testing code, but should not be merged because >>> omap4 has the iopad wake-ups available for uarts. So those can >>> be always enabled. >> >> In this case, 2 IRQ will be received per each UART RX event - one from >> PRCM and from UART - and that's not good from PM perspective (It will >> affect on CPUIdle and CPUFreq at least). > > Oh I see, that's because I accidentally left the debug code enabled > to make it easier to test the wake-up events without having to > have working off-idle. The wake flags can be kept on always for > sure. > > The patch below should sort out the issue of getting wake-up interrupts > during runtime as long as you don't have DEBUG defined. > > Regards, > > Tony > > --- a/drivers/pinctrl/pinctrl-single-omap.c > +++ b/drivers/pinctrl/pinctrl-single-omap.c > @@ -140,9 +140,17 @@ static irqreturn_t pcs_omap_handle_irq(int irq, void *data) > if ((val & OMAP_WAKEUP_EVENT_MASK) == OMAP_WAKEUP_EVENT_MASK) > generic_handle_irq(wakeirq); > } > - > +#ifdef DEBUG Don't think it's debug code - IO chain need to be rearmed after each PRCM IO IRQ - otherwise IO wakeup events may be lost (at least on OMAP4, OMAP5 requires more complex handling(( ). > + /* > + * This enables wake-up interrupts during runtime also > + * causing duplicate interrupts. But it also makes debugging > + * the wake-up events easy as deeper idle states often are > + * not working for new devices while the drivers are being > + * developed. > + */ > if (pcso->reconfigure_io_chain) > pcso->reconfigure_io_chain(); > +#endif > > return IRQ_HANDLED; > } > I didn't pick up your padconf patches yet -seems i need to be in sync :) Below the diff I used to verify IO wake up (It follows old IO daisy chain hanlding models in hwmod before DT): * @@ -144,6 +144,7 @@ static void omap_prcm_irq_handler(unsigned int irq, struct irq_desc *desc) chip->irq_unmask(&desc->irq_data); prcm_irq_setup->ocp_barrier(); /* avoid spurious IRQs */ + omap44xx_prm_reconfigure_io_chain(); } --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -574,7 +574,7 @@ odbs_exit: return ERR_PTR(ret); } - +#include "prm44xx.h" #ifdef CONFIG_PM_RUNTIME static int _od_runtime_suspend(struct device *dev) { @@ -586,6 +586,7 @@ static int _od_runtime_suspend(struct device *dev) if (!ret) { omap_device_idle(pdev); pinctrl_pm_select_idle_state(dev); + omap44xx_prm_reconfigure_io_chain(); } return ret; @@ -596,6 +597,7 @@ static int _od_runtime_resume(struct device *dev) struct platform_device *pdev = to_platform_device(dev); pinctrl_pm_select_active_state(dev); + omap44xx_prm_reconfigure_io_chain(); omap_device_enable(pdev); diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 228b850..5db073a 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c @@ -79,7 +79,7 @@ static void omap_prcm_events_filter_priority(unsigned long *events, events[i] ^= priority_events[i]; } } - +#include "prm44xx.h" /* * PRCM Interrupt Handler