Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4009557ybg; Tue, 29 Oct 2019 00:22:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDvoFTPjuFXc0xkcRBNDlTuyD6F9a4K9LCH5AotHxzVny5AiPGpGRPI7p0bdkXXYNDoGnQ X-Received: by 2002:a17:906:7f94:: with SMTP id f20mr1782906ejr.333.1572333752356; Tue, 29 Oct 2019 00:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572333752; cv=none; d=google.com; s=arc-20160816; b=1EpCF4rRTTK2eF5FbJMlBMQn1SNo+Hv95v8D3wILzshU1Qhqo979Bx2SK949R8X2Rg 0i5pVsPfsXWYttwG5LCl3w36UaIf1C7KznWipQaRHBVSDcRJk5GszXRJQdGqRkBjkzoy C+w5YFFtkea1TwGykI20n9bTvWyzmuHcGRLy/bh8qP61rAUU2wmDqpozrub+2DeYX0b5 PSPJoACZm3stDxPzMsc4OVr/Yz3rRaVOy02eYh2musW7/0r89xgaqtpPZcIB/aTFSXYc j+xROc4rE73cdgADaY/hT8HuJU3Bac2XVHLuQGBkJ5huFJ/ND/F2BV3iNrEemHRIhn/i 9Xtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=2IBme5YbSNymUAfRnTsJqe+y/r2xilei6gWEgZR+1K0=; b=VpAETZcNrXafTqj5e2Uwmb/i6uR0UXNd/YMRzVNCpkORZjHAAUUD8HCqkauSu6b1Xd s0Ya+ybQagkuEZWNJ/B2PQsz5cLLW72P0Xkw2z07ww8z8Xh4on0SxCwjUDdx0m7xPt+b zHrzIpP8UCSS8IgLonT1EnqY9yITVV9TurZ8a+bFTm3xUdFCRraELN49QT/bAEGy0yCu ucQku9Fnpo8fwEgzHPMVphZB/BtZ7qyAHDMvNa7JblP87nkZEWZNnHnSWpW5oAEc1nGd TYkpVoOMiih6NxWxmMYL74z9oyRkUeikRiQ6E+vUTvioXy20vNqqtm08Bor5RuD/QngE ADeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=JpS+61pb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14si5558890edf.199.2019.10.29.00.22.08; Tue, 29 Oct 2019 00:22:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=JpS+61pb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729251AbfJ2BqB (ORCPT + 99 others); Mon, 28 Oct 2019 21:46:01 -0400 Received: from vps.xff.cz ([195.181.215.36]:52226 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727379AbfJ2BqB (ORCPT ); Mon, 28 Oct 2019 21:46:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1572313559; bh=bhzP3bhLk0Yol8s//otk/IDBmGkxLhl6fpdcUqfP75w=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=JpS+61pbJDVyKblhRaIm8JKjWkdojeV3KkxIdJT7+eXBFH95J36s8aeAEdwN/SCmT mbtRRj0QAxxeQABDjCt+q665021+BQa2joEzZStqmCaz6bSZi7FpMfanHh5s2LbpoA qHs9wXu4OYQVXaCynhiU9hEUyQ7giGGeUGr+Ho/I= Date: Tue, 29 Oct 2019 02:45:59 +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: <20191029014559.gif3ay7anq24un2i@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191029001250.GB57214@dtor-ws> X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Anyway, I'm no PM expert. I started looking at PM code about two weeks ago, and I really don't feel like I can contribute much to these kinds of decisions with my current level of understanding, right now. regards, o. > Thanks. > > -- > Dmitry > > -- > You received this message because you are subscribed to the Google Groups "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. > To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20191029001250.GB57214%40dtor-ws.