From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A404CA9EAE for ; Tue, 29 Oct 2019 12:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B84C721479 for ; Tue, 29 Oct 2019 12:43:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=megous.com header.i=@megous.com header.b="lB3OlaK+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387828AbfJ2Mne (ORCPT ); Tue, 29 Oct 2019 08:43:34 -0400 Received: from vps.xff.cz ([195.181.215.36]:32896 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727675AbfJ2Mne (ORCPT ); Tue, 29 Oct 2019 08:43:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1572353011; bh=k3Nz5ZjLe0bnhm7wv+maW9ij16pFEqan6p8GTLgONJE=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=lB3OlaK+8qw1a9OhXelLYEtS7kgLE3SNVXasH07XVZyr5LOr2fUFsp3FKKr1EpZi5 eBsbPmfSk7r1Ml/o0ED8JU5AZLsfeW1+/haYNRQYuErqWcPvKJzqY4KfLZECEJMmMb Cunx4bJni6LzSFIVbwFU+qrSEhiVGx7L+5HYYd4Q= Date: Tue, 29 Oct 2019 13:43:31 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Dmitry Torokhov Cc: linux-sunxi@googlegroups.com, Hans de Goede , Maxime Ripard , Chen-Yu Tsai , "open list:SUN4I LOW RES ADC ATTACHED TABLET KEYS DRIVER" , "moderated list:ARM/Allwinner sunXi SoC support" , open list Subject: Re: [linux-sunxi] Re: [PATCH] input: sun4i-lradc-keys: Add wakup support Message-ID: <20191029124331.7yh5kccsq2syxm47@core.my.home> Mail-Followup-To: Dmitry Torokhov , linux-sunxi@googlegroups.com, Hans de Goede , Maxime Ripard , Chen-Yu Tsai , "open list:SUN4I LOW RES ADC ATTACHED TABLET KEYS DRIVER" , "moderated list:ARM/Allwinner sunXi SoC support" , open list References: <20191028221502.3503543-1-megous@megous.com> <20191028233828.GA57214@dtor-ws> <20191028235626.5afvszxtppsieywi@core.my.home> <20191029001250.GB57214@dtor-ws> <20191029014559.gif3ay7anq24un2i@core.my.home> <20191029041804.GF57214@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191029041804.GF57214@dtor-ws> X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Mon, Oct 28, 2019 at 09:18:04PM -0700, Dmitry Torokhov wrote: > On Tue, Oct 29, 2019 at 02:45:59AM +0100, Ondřej Jirman wrote: > > On Mon, Oct 28, 2019 at 05:12:50PM -0700, Dmitry Torokhov wrote: > > > On Tue, Oct 29, 2019 at 12:56:26AM +0100, Ondřej Jirman wrote: > > > > On Mon, Oct 28, 2019 at 04:38:28PM -0700, Dmitry Torokhov wrote: > > > > > > + > > > > > > + error = dev_pm_set_wake_irq(dev, irq); > > > > > > + if (error) { > > > > > > + dev_err(dev, "Could not set wake IRQ\n"); > > > > > > + return error; > > > > > > + } > > > > > > + > > > > > > > > > > I wonder if we could teach platform driver core to handle this for us. > > > > > > > > Not sure, some drivers do enable/disable wake_irq by hand in suspend/resume > > > > callbacks, so it would probably need to be opt-in somehow. I guess calling the > > > > function like this is one way to make it opt-in. > > > > > > > > The other way may be by passing a flag somewhere, like to > > > > request_threaded_irq. Did you have something more concrete in mind? > > > > > > I think it is perfectly fine to continue using enable_irq_wake and > > > disable_irq_wake from the driver while marking irq as being wake irq > > > form the core. > > > > I see, it looks like irq_set_irq_wake will track the calls via wake_depth > > > > https://elixir.bootlin.com/linux/latest/source/kernel/irq/manage.c#L714 > > > > But all irqs are not necessarily wake irqs, no? So it still may need to be > > opt-in somehow. > > I thought we'd do that for IRQ named "wakeirq" or the very first IRQ if > there is no named IRQ, and when we have the "wakeup-source" property, > similarly to what we do in I2C bus. I see. I've looked at drivers using dev_pm_set_wake_irq and dev_pm_set_dedicated_wake_irq and not many platform drivers would potentially benefit (~25 out of 2300), of those only some use OF and are platform drivers, maybe 15-20: https://elixir.bootlin.com/linux/latest/ident/dev_pm_set_wake_irq https://elixir.bootlin.com/linux/latest/ident/dev_pm_set_dedicated_wake_irq I don't think it's worth it. regards, o. > Thanks. > > -- > Dmitry > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel