Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp254933ybb; Tue, 7 Apr 2020 22:09:17 -0700 (PDT) X-Google-Smtp-Source: APiQypIs4W2OLsty27Vbes55CHqSeRdKUKrpqa+fcWbk5L38IuFjDoYVuspRSrrw+7rWTqHUtf5t X-Received: by 2002:a05:6808:605:: with SMTP id y5mr1244328oih.172.1586322557283; Tue, 07 Apr 2020 22:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586322557; cv=none; d=google.com; s=arc-20160816; b=jm22jIGBIHCZeWQ15aKYNWkLq0CuHdbq93NZObeLO2IG8Dbkr9AlZyQOGRMv90vxFA RbiNEoxKij/IM2MmlhaprH2C0uzcZlyqTJKsjfkSq3AFs14yHtZAXDoOwGJwHfbZXIH/ x5m+vyeDkr2LiXTEp7pmO/L9ZtXzOVPCi5Bcn63AM5eAz+aLs2MEsXR2b9reBR/J0EUl 88lHlkbVWo2ZeVPAyxPcOcDIO7olI1sgDtKlng2W4wV4XJQSFGXIEQ8aq9z3F8eNxg1z bpY8SThKtKBup0VVR2RMd/ALsHVXgLLAr4Kv4pqIgfglgtGXNO0ZVi0+uSzfiGNDFIPi 52Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=RVqYLzvz5LKqumC9icZHSiO0RIIhX7YU71aDHaxaFJE=; b=LdfRKuee9AmlTjkFuY+9r2Kfp/syyi4lnhuRiQQ2yC8P2szZOKD3D+oJpINDWAxDyZ s0zWbr3jQ6KnajLaorE3Rn/ukw22pR8+YL/CO/dkkpYs4RD0cUedd/VZy6Ugj4oDxMfh OqOi6wBO79Wp066g1GAy/Iiwxkng8OmPMn7nze/ckG2MqieBC2yGLpsTtEBC7LBTlZJA 2ElLo69KClaCl49Ce2WWQu6rwXwR6Szrou8JbfSa8RWnCFJzEM6yRH58SIvL3AgnvG3p 47+hS44UXmFtgSAPc3ZKARIP4f4q3pvzcb7af8R7ciyk/XtEPnZ2jFLI094QCeadaJN1 wQcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mt2UO1ks; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j25si2108865otr.178.2020.04.07.22.09.03; Tue, 07 Apr 2020 22:09:17 -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=@chromium.org header.s=google header.b=mt2UO1ks; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727115AbgDHFGq (ORCPT + 99 others); Wed, 8 Apr 2020 01:06:46 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33764 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgDHFGq (ORCPT ); Wed, 8 Apr 2020 01:06:46 -0400 Received: by mail-wr1-f68.google.com with SMTP id a25so6311298wrd.0 for ; Tue, 07 Apr 2020 22:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RVqYLzvz5LKqumC9icZHSiO0RIIhX7YU71aDHaxaFJE=; b=mt2UO1ksFUf2Wqcy/GXaoOoCVWX2OeRgET0TvIwM1qEhWK0CR1YeHqkacSxJv/P8fU VRA2yUT2pdNNBlBgUjtuWicF7bp7SIQxCJV403Pr1MDRJ0rxyUehQKnlOvLM1Ut+1qbD YDyaE7xaFAI8xHJ4/UwY5fE1ZAG0sWOpBgYTQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RVqYLzvz5LKqumC9icZHSiO0RIIhX7YU71aDHaxaFJE=; b=qZV9wUNw+m1FXPBGCQUCWy2vuDfu3fJ7sjq+HyKQBQROzz9UuQWZgYzRKrbCL8l5Er XywbRIWVcITHhE4VH2X5B4Tbz/N/Yt+ImVbC/X5W0lOQ4JyXp+eCBA3DJq6InqQ5tAgR 8ppnoabnbJ1+SeDEv5V4DFuQfIjWDbCeF26dpiBIHRcCDUe+/YlBvZRbazw4gb5+SuDl pBOqfGxa0ZoyjlJcX/98JaLy8Yq/imp8SMr3ekhSb8VqO5dj8KfcTMjb0f5DFistSjVI 970cOVriJfRGnkFx/s6XmrJ1Wk5nZEaK6DKKsyAPC2bEcuVRFm6KPZJF5r0GEXbXlylW ZWYw== X-Gm-Message-State: AGi0PuakawNbpDQuCYhmY8hYUYOxszQk8Tq9wLXUTs8/bWWPOOn0Yayo 9U/XsChdRrQbiEyFvhRLu7RXDg2qumvnfCJcpw4mKQaI X-Received: by 2002:adf:fa51:: with SMTP id y17mr6697995wrr.358.1586322403655; Tue, 07 Apr 2020 22:06:43 -0700 (PDT) MIME-Version: 1.0 References: <20200327151951.18111-1-ricardo.canuelo@collabora.com> <20200327154345.GA3971@ninjato> In-Reply-To: From: "dbasehore ." Date: Tue, 7 Apr 2020 22:06:32 -0700 Message-ID: Subject: Re: [PATCH] i2c: enable async suspend/resume on i2c devices To: Ezequiel Garcia Cc: Wolfram Sang , =?UTF-8?Q?Ricardo_Ca=C3=B1uelo?= , linux-i2c@vger.kernel.org, Guenter Roeck , Linux-pm mailing list , Linux Kernel Mailing List , kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 29, 2020 at 5:49 AM Ezequiel Garcia wrote: > > Hi Derek, > > On Fri, 27 Mar 2020 at 17:26, dbasehore . wrote: > > > > On Fri, Mar 27, 2020 at 8:43 AM Wolfram Sang wrote: > > > > > > On Fri, Mar 27, 2020 at 04:19:51PM +0100, Ricardo Ca=C3=B1uelo wrote: > > > > This enables the async suspend property for i2c devices. This reduc= es > > > > the suspend/resume time considerably on platforms with multiple i2c > > > > devices (such as a trackpad or touchscreen). > > > > > > > > (am from https://patchwork.ozlabs.org/patch/949922/) > > > > > > > > Signed-off-by: Derek Basehore > > > > Reviewed-on: https://chromium-review.googlesource.com/1152411 > > > > Tested-by: Venkateswarlu V Vinjamuri > > > > Reviewed-by: Venkateswarlu V Vinjamuri > > > > Reviewed-by: Justin TerAvest > > > > Signed-off-by: Guenter Roeck > > > > Signed-off-by: Ricardo Ca=C3=B1uelo > > > > --- > > > > > > Adding linux-pm to CC. I don't know much about internals of async > > > suspend. Is there a guide like "what every maintainer needs to know > > > about"? > > > > For more details, you can look at the function dpm_resume in the > > drivers/base/power/main.c file and follow from there. > > > > I can't find anything in Documentation/, so here's a short overview: > > Async devices have suspend/resume callbacks scheduled via > > async_schedule at every step (normal, late, noirq, etc.) for > > suspending/resuming devices. We wait for all device callbacks to > > complete at the end of each of these steps before moving onto the next > > one. This means that you won't have a resume_early callback running > > when you start the normal device resume callbacks. > > > > The async callbacks still wait individually for children on suspend > > and parents on resume to complete their own callbacks before calling > > their own. Because some dependencies may not be tracked by the > > parent/child graph (or other unknown reasons), async is off by > > default. > > > > Enabling async is a confirmation that all dependencies to other > > devices are properly tracked, whether through the parent/child > > relationship or otherwise. > > > > Have you noticed the async sysfs attribute [1]? > > Given this allows userspace to enable the async suspend/resume, > wouldn't it be simpler to just do that in userspace, on the > platforms you want to target (e.g. Apollolake Chromebook devices, and so = on) ? I don't remember much since I attempted this a long time ago. That sounds like it would be reasonable under many circumstances though. > > Thanks, > Ezequiel > > [1] Documentation/ABI/testing/sysfs-devices-power > > > > > > > > This patch was originally created for chromeos some time ago and I'= m > > > > evaluating if it's a good candidate for upstreaming. > > > > > > > > By the looks of it I think it was done with chromebooks in mind, bu= t > > > > AFAICT this would impact every i2c client in every platform, so I'd= like > > > > to know your opinion about it. > > > > > > > > As far as I know there was no further investigation or testing on i= t, so > > > > I don't know if it was tested on any other hardware. > > > > > > > > Best, > > > > Ricardo > > > > > > > > drivers/i2c/i2c-core-base.c | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-bas= e.c > > > > index cefad0881942..643bc0fe0281 100644 > > > > --- a/drivers/i2c/i2c-core-base.c > > > > +++ b/drivers/i2c/i2c-core-base.c > > > > @@ -769,6 +769,7 @@ i2c_new_client_device(struct i2c_adapter *adap,= struct i2c_board_info const *inf > > > > client->dev.of_node =3D of_node_get(info->of_node); > > > > client->dev.fwnode =3D info->fwnode; > > > > > > > > + device_enable_async_suspend(&client->dev); > > > > i2c_dev_set_name(adap, client, info); > > > > > > > > if (info->properties) { > > > > -- > > > > 2.18.0 > > > >