Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp600306pxb; Tue, 15 Feb 2022 23:23:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxF2viZB/QkRH1tSdOVMlr8Vcq2XAAFU5IlJPdhYji9NM1FgnN1HZS0cZSPZAq4BMzcBZhi X-Received: by 2002:a17:903:11c5:b0:14f:500:e442 with SMTP id q5-20020a17090311c500b0014f0500e442mr1361047plh.27.1644996185539; Tue, 15 Feb 2022 23:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644996185; cv=none; d=google.com; s=arc-20160816; b=epa9aLBs4QrgOTM5DCPTruQOXxePkT/4fiGwYY4dBhKOd9Dd3onPlbX4Tp8kGDfnbn rX6ilyC7kARrJD19EGLSjeoutOYnlP8G6bR8S8xd6011A+iXzkr+py9XezH4clytcnpZ k+hBF3CygM800tRcTMu/HNGd0PM7p4nSw4rbkpxyub7/EBmVrAEWKygn9zx2AC6RzVbg raUPD0XsJWTmwXUnvBLzhJtEJUs9F/99uTnWx/U7xHe0iTlCZv4GKJvjo+0N4xFdm0R0 K7hhcn3ZrbaGUqUGf5Ze7Ri0FaNdbIQu0CXkEidPwYq9q0itHoqLIdxM6M4aZyemV4Ki 7uKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=elu8Ka2cZem2k4zQRGJEv65TLQWlji0lH04NXcgaWoI=; b=FBeSHY4Mrckd47hbKq56169J+NEhFm89OCE3DB6AIr/MDrphCB6Ch3R/JyAE49ByQM GZAOdYiPjInFD/1h2VUU1SUUwH+rDdXDXcM9Y1DIKWKNkklzZEosphsnS1aQV1sICnBG Z8o6TW1CM5s4b6fok15p6X7fPlkbzzYw6yDMiR+s8Y14vFff+m+cSgS18pQ84gfNXdaS Y4fdSL8hbUWNyDggf29dUa1pvxbb1eJV7h2dZ5mlQS6LgPJ+Dl11YyLbeFOA/eFXGsSr C/A57gpqPKrv3wDKQtkrl3Tk52aHBa2vyOuVLLKx7ABc9xWAE8tZUjiMDZMXCtw1pWhY SM0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LVuSa+60; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e8si4879286pgb.518.2022.02.15.23.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:23:05 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LVuSa+60; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F6452804F0; Tue, 15 Feb 2022 22:52:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344679AbiBPFrd (ORCPT + 99 others); Wed, 16 Feb 2022 00:47:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235893AbiBPFrc (ORCPT ); Wed, 16 Feb 2022 00:47:32 -0500 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AED3F1AF6 for ; Tue, 15 Feb 2022 21:47:21 -0800 (PST) Received: by mail-yb1-xb31.google.com with SMTP id bt13so2861070ybb.2 for ; Tue, 15 Feb 2022 21:47:21 -0800 (PST) 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; bh=elu8Ka2cZem2k4zQRGJEv65TLQWlji0lH04NXcgaWoI=; b=LVuSa+60cggKNTvJ1zIakxD1VIAn5f/pbblK/YjQD5LI7TD31BHIqZ24c6BKqeGFCI OaEmU2yh7N6fQW6FBGELn61X/aBcQctz+GZJlD44yKuQ8BpCCCk9taP4fVgo/fJyMHo+ exJd028Ht/JAdX4P236LDPuuUXUe1VYdLdI4Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=elu8Ka2cZem2k4zQRGJEv65TLQWlji0lH04NXcgaWoI=; b=KZqUg80iElXq/6h09imNaCYhaCpFP1ICzFJ8ji3Z6/aLe3k097l7xas/3zaGnUJLfA zvIRzf+pfqQXk6SRH/eFs+QvEepDr0CAoxB9ehD8iu2kk2tnTlw6sSBHCnPhZAFSSn6b sadHEYFIxOnMr0PiWWsxaPWIwe/4LWup7LvXrQeX/bH4zowJ8nsFMIiGgAJDZWdWDT3H S4vfYOXd1EmCo9Loh2a+litNF26og3jRJ5PQmD5nl6J2DoN7D7yT52TeeWps+umGQ35m rnfFj0Mk09kRK6SBh/WDT1KvRQ/gSEIMlofhAsxK7C78wWacs7OmxCs8icELO6CO4Zkf eV1w== X-Gm-Message-State: AOAM530hbNVws+1T9p6jhZDuqFkpUQgwlOP9In5mxg9MX8gk9xoYxBdB cTvEX8AELQ8ZPnbxD/Li64sKy+Fr+b+uzfJw+UjjZQ== X-Received: by 2002:a25:8b0a:0:b0:61a:4aab:3e78 with SMTP id i10-20020a258b0a000000b0061a4aab3e78mr880886ybl.619.1644990440308; Tue, 15 Feb 2022 21:47:20 -0800 (PST) MIME-Version: 1.0 References: <20220216043639.3839185-1-tzungbi@google.com> <20220216043639.3839185-4-tzungbi@google.com> In-Reply-To: <20220216043639.3839185-4-tzungbi@google.com> From: Prashant Malani Date: Tue, 15 Feb 2022 21:47:09 -0800 Message-ID: Subject: Re: [PATCH v4 3/5] platform/chrome: cros_ec: initialize `wake_enabled` in cros_ec_register() To: Tzung-Bi Shih Cc: bleung@chromium.org, groeck@chromium.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 15, 2022 at 8:37 PM Tzung-Bi Shih wrote: > > `wake_enabled` indicates cros_ec_resume() needs to call > disable_irq_wake() to undo enable_irq_wake() in cros_ec_suspend(). > > Initialize `wake_enabled` in cros_ec_register() and determine the flag > in cros_ec_suspend() instead of reset-after-used in cros_ec_resume(). > > Signed-off-by: Tzung-Bi Shih One minor thing to consider, but regardless: Reviewed-by: Prashant Malani > --- > Changes from v3: > (https://patchwork.kernel.org/project/chrome-platform/patch/20220209095703.517608-4-tzungbi@google.com/) > - Change the patch title. > - Simplify by initializing wake_enabled in cros_ec_register(). > > No changes from v2. > > Changes from v1: > (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T/#u) > - Use imperative mood in commit message. > > drivers/platform/chrome/cros_ec.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c > index 25cd8df6e7b0..b6604a9ab315 100644 > --- a/drivers/platform/chrome/cros_ec.c > +++ b/drivers/platform/chrome/cros_ec.c > @@ -191,6 +191,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) > ec_dev->max_passthru = 0; > ec_dev->ec = NULL; > ec_dev->pd = NULL; > + ec_dev->wake_enabled = false; > > ec_dev->din = devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL); > if (!ec_dev->din) > @@ -383,10 +384,9 @@ int cros_ec_resume(struct cros_ec_device *ec_dev) > dev_dbg(ec_dev->dev, "Error %d sending resume event to ec", > ret); > > - if (ec_dev->wake_enabled) { > + if (ec_dev->wake_enabled) > disable_irq_wake(ec_dev->irq); > - ec_dev->wake_enabled = 0; > - } > + Better to leave it as is, and ensure "wake_enabled" is cleared after resume? Will result in a smaller diff. I'll leave it up to you. -Prashant