From patchwork Wed Nov 15 22:28:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10060451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DE7A560231 for ; Wed, 15 Nov 2017 22:28:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4D7F2A327 for ; Wed, 15 Nov 2017 22:28:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C99372A334; Wed, 15 Nov 2017 22:28:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 028D12A327 for ; Wed, 15 Nov 2017 22:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933435AbdKOW2L (ORCPT ); Wed, 15 Nov 2017 17:28:11 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:42618 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933431AbdKOW2L (ORCPT ); Wed, 15 Nov 2017 17:28:11 -0500 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23992297AbdKOW2IhqrTZ (ORCPT ); Wed, 15 Nov 2017 23:28:08 +0100 Date: Wed, 15 Nov 2017 23:28:07 +0100 From: Ladislav Michl To: Tony Lindgren Cc: linux-omap@vger.kernel.org, Grygorii Strashko Subject: Re: OMAP3 interrupt latency much worse when CPU idle Message-ID: <20171115222807.bfptned3323bjdkr@lenoch> References: <20171109214756.cptxuqmtqwkm33iu@lenoch> <20171109215707.GG28152@atomide.com> <20171109223203.zqf2rnjgxb5jekwg@lenoch> <20171109223740.GI28152@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171109223740.GI28152@atomide.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Nov 09, 2017 at 02:37:40PM -0800, Tony Lindgren wrote: > * Ladislav Michl [171109 22:33]: > > On Thu, Nov 09, 2017 at 01:57:07PM -0800, Tony Lindgren wrote: > > > Maybe you can block idle states from your driver with PM QoS? > > > > > > Just add some latency requirement. See for example what was done > > > earlier for omap3 audio in commit 9834ffd1ecc3 ("ASoC: omap-mcbsp: Add PM > > > QoS support for McBSP to prevent glitches"). > > > > > > Not sure if we can do this in a generic way.. But maybe it's doable for > > > things like PWM drivers. > > > > That seems to be rather problematic as I need this for generic driver: > > drivers/media/rc/gpio-ir-recv.c > > I need to be able to detect key presses of various remotes, so protocol > > is unknown in advance. Having such a big jitter leads to false positives > > when guessing protocol or decoding errors. > > > > I was also considering using FIQ handler, but it probably won't help in > > this case. > > Hmm to me it seems that PM QoS would be totally justified for a driver > like that. So, looked at above mentioned commit and tried patch bellow without any noticeable change. Also PM QoS seems to handle DMA and network latency only. I need to handle IRQ latency. Any other options? Thank you, ladis --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index b6c4a2d2b696..5c580bf70ff8 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -92,6 +93,10 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) gpio_dev->rcdev = rcdev; + rc = dev_pm_qos_expose_latency_limit(dev, 10); + if (rc < 0) + return rc; + rc = devm_rc_register_device(dev, rcdev); if (rc < 0) { dev_err(dev, "failed to register rc device (%d)\n", rc);