From patchwork Tue Jun 27 07:32:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 9810977 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 1F13560329 for ; Tue, 27 Jun 2017 07:33:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D7DB1FF27 for ; Tue, 27 Jun 2017 07:33:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 009752818A; Tue, 27 Jun 2017 07:33:21 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 864571FF27 for ; Tue, 27 Jun 2017 07:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZOFMqnnwnkNSaylcwY8Fq2+HPr1PVVbIoEzz0mju1NA=; b=LGRy68ha/ArXku wqwURYZkTHaGV9tjG4eyxjxjljjPcUpn0bRfK7YoCup6LXvqkBVt/gIBaD1CS7rPNXwxXTergjwj8 YqBGVZsj/BZeVLoZCHdq0ADvuG9lA6hxXJAdZvDkX0w0xbEV8X5AEkTBY7SSA6UGVSz0sU4iWP3S6 gG4LIZNQHxX0eUIBXV7/242kHIMuj1Y64cxfleIUc6CA5zg6/4V9ovAQASVBNcDFjYQqUXq3O0uYq iL+TwT9xIsjFILmtvOeT8Wf8HmWUcD9jqAAytCws10usEkAQRApmPxWKe4iCsjQTLaJmJbKmW2Llc 9TGRtXtAZyEPdF2FoMCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dPkzv-00065j-9p; Tue, 27 Jun 2017 07:33:19 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dPkzs-00063h-5e for linux-rockchip@lists.infradead.org; Tue, 27 Jun 2017 07:33:18 +0000 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 742A3812D; Tue, 27 Jun 2017 07:33:05 +0000 (UTC) Date: Tue, 27 Jun 2017 00:32:50 -0700 From: Tony Lindgren To: Brian Norris Subject: Re: [PATCH for 4.12] Revert "pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip" Message-ID: <20170627073249.GY3730@atomide.com> References: <20170517225634.GA11404@google.com> <20170527021900.GA119873@google.com> <20170623205911.GA143883@google.com> <20170627000622.GA63039@google.com> <20170627062409.GX3730@atomide.com> <20170627070731.GA23083@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170627070731.GA23083@google.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170627_003316_295007_47F5CDCD X-CRM114-Status: GOOD ( 18.51 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?B?J+m7hOa2myc=?= , Heiko Stuebner , Julia Cartwright , Peter Zijlstra , Linus Walleij , linux-pm@vger.kernel.org, LKML , Doug Anderson , linux-rockchip@lists.infradead.org, John Keeping , linux-gpio@vger.kernel.org, "David.Wu" , Thomas Gleixner , "Paul E. McKenney" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP * Brian Norris [170627 00:07]: > On Mon, Jun 26, 2017 at 11:24:09PM -0700, Tony Lindgren wrote: > > Hmm so how come drivers/bluetooth/btusb.c can't use the generic > > dev_pm_set_dedicated_wake_irq()? Can you please take a look? > > I took a look previously, and last time I did, there were too many bugs > for it to be useful. You may have fixed the ones I reported w.r.t. > assumptions about runtime PM. Yes several issues got fixed over past few years. If you find issues please let me know, otherwise I can't help. > I also recall there being some difficulty with supporting > level-triggered interrupts that way. (This signal has no device-level > mask, and it triggers for all sorts of BT activity. There may not be a > relevant "edge".) Well typically the wakeirq needs to be disabled during runtime like we do for the generic wakeirqs. It might be connected to the RX line for example so it's just noise during runtime. If you actually need it during runtime then it's a separate story but I doubt that's the case here. Talking of GPIO interrupt triggering, I wonder if something like below might help? It seems we're missing the setting of triggering, see below. > > If there are issues remaining let's rather fix them so we can get rid > > of the custom tinkering of wake-up events in the drivers. > > That's nice, but that doesn't answer my questions. Perhaps that's a side > project. The point is that we're clearly violating the documented APIs. Certainly all these issues need to be fixed if we intent to use it. Funny how I have not run into these with my test cases. Do you have a GPIO irqchip on I2C for handling the wake-up interrupts? Regards, Tony 8< ------- diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -198,7 +198,8 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq) * so we use a threaded irq. */ err = request_threaded_irq(irq, NULL, handle_threaded_wake_irq, - IRQF_ONESHOT, dev_name(dev), wirq); + irq_get_trigger_type(irq) | IRQF_ONESHOT, + dev_name(dev), wirq); if (err) goto err_free;