Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp700134rwb; Thu, 18 Aug 2022 10:33:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR42PfxXyIvjYTes4i30Kbqy6Dmpn9GggkY2UdCTm3fVRXK086UWK5Y/ISRkMmcdyATNS46B X-Received: by 2002:a17:903:32c9:b0:171:2846:eef8 with SMTP id i9-20020a17090332c900b001712846eef8mr3871709plr.117.1660844031703; Thu, 18 Aug 2022 10:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660844031; cv=none; d=google.com; s=arc-20160816; b=pUciYoLYjPJosU4eGLpGjieEOYBx5G7jmDgbyMIp1zExBd2qEvfuayrxbk2ciiufIQ gevqnpJ5XG5mLfwAS2KTZNK7z/HjmiXq060UEDa5Ek0jF2kcpf0OIy++Bpqt/GADdVtu ntu9l5b/FrVFbtq3pjCU8lO8yqxTGGzuqnN27sU1IioohyHziyTdE3bWv5wk7qEiva3i 49tvZol7igmU29leST85hFrVDvQXrKJvskmcDsASyiC9H2qn7cakcj8crGdPWj2n64pS NVExN7FSTYOZDh/PA00LheKrn5+uCmgXdMQTnLIJlxMJmqhhqMSX4Hnlp28nUponheUo WKcA== 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=WmBqeJ78050aXLKgOwLTPwBE6TsmJMEDRuI6qelXVno=; b=cMwIKk3kh1JAty6zqjJgnYHZ3wHbBfy2A+PbkUpAtzsixvt0vGkXK/Vyy8tP3v5kk1 kyRpb0Er+wd6OhgausiNFG5HenFTFVVhsMcLp70i4En9v4PaCRJ8T/raxZjdF6ei7VLk z31UMYaLtcsIM+0ccVxfazqe8Ef139L2f+d5goN+r7btVWhgYwrpcdTajYicpy+c59CY lFt5x8SgZirmwfwPxII8S21TZE5yXQKD9Bfy7dfPmSG8xImD/tg3I+MsTAcqlldDWDlm mDQdS3dzO/dPJ5p2Y4TueGY8q4s4N/62GqzwLbSInbUZh3BzPy779Uo9yZ6/GAA2ZUUD 2Tog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CBVHuUfu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jd13-20020a170903260d00b00171311372d5si1636396plb.271.2022.08.18.10.33.39; Thu, 18 Aug 2022 10:33:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CBVHuUfu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1344699AbiHRRZY (ORCPT + 99 others); Thu, 18 Aug 2022 13:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345417AbiHRRZE (ORCPT ); Thu, 18 Aug 2022 13:25:04 -0400 Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF304D839 for ; Thu, 18 Aug 2022 10:24:34 -0700 (PDT) Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-333a4a5d495so59139197b3.10 for ; Thu, 18 Aug 2022 10:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=WmBqeJ78050aXLKgOwLTPwBE6TsmJMEDRuI6qelXVno=; b=CBVHuUfuyWcCZNBWBq/+y/JHPvetpvzju+JjhM+v3zR68gaL+f+jaybMfNWIJo0ukv MteuvRIcYU28PD6BBoRIRYfAQscIw8740RBblr8y+jf7nKJA5OQ8kd6qCkXrLw0QbMk9 q0hrBTX4MDTnVEVeCDrwR7JxRflSQdwzZzb9M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=WmBqeJ78050aXLKgOwLTPwBE6TsmJMEDRuI6qelXVno=; b=bXnV59XQk3eNNaqc69l4oTs6ptOBRJhwtXfPc4dj1118Ka68tCyj8QZQx+2shmByIV KspMGjNGsLz05oZm+01NFeGIY7tR2Wz8TMApsDsDPg8o5ilNDknxheTlo2oej+7lNQxS lF1K7tvuVElNIU/Pmm9mTtz3m8CeSSnVEtjhNhWeWDA6UsJIRADiauBpnPN7M3dxVabh vYza4W2ImA8uAGbda46mVfPU+Tyo0KHAvhuvin27whZdp6ubZ1vpVnK327eoSBUX5sct V2ckrJkL2oTtk+URVm0WAdFtvfmzCGLIJtQnunOKF89pGctG6Erz9mACo4v/hGiE/xk1 ze4w== X-Gm-Message-State: ACgBeo31xiHmD3TVajCLz3dVKPwhmN2Cwe/p9qqMkeOhuXr3o2JBb/JS Q9GvWYmjIQ8xddZcSO46iW4kJfaOBW+aufGaeiCOv72wmhU= X-Received: by 2002:a25:4ce:0:b0:67c:3362:c396 with SMTP id 197-20020a2504ce000000b0067c3362c396mr3963221ybe.336.1660843473754; Thu, 18 Aug 2022 10:24:33 -0700 (PDT) MIME-Version: 1.0 References: <20220818082827.v2.1.Idd188ff3f9caddebc17ac357a13005f93333c21f@changeid> In-Reply-To: <20220818082827.v2.1.Idd188ff3f9caddebc17ac357a13005f93333c21f@changeid> From: Prashant Malani Date: Thu, 18 Aug 2022 10:24:23 -0700 Message-ID: Subject: Re: [PATCH v2] platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs To: Evan Green Cc: Enric Balletbo i Serra , Tzung-Bi Shih , Rajat Jain , Benson Leung , Guenter Roeck , Lee Jones , Tinghan Shen , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Thu, Aug 18, 2022 at 8:29 AM Evan Green wrote: > > In modern Chromebooks, the embedded controller has a mechanism where > it will watch a hardware-controlled line that toggles in suspend, and > wake the system up if an expected sleep transition didn't occur. This > can be very useful for detecting power management issues where the > system appears to suspend, but doesn't actually reach its lowest > expected power states. > > Sometimes it's useful in debug and test scenarios to be able to control > the duration of that timeout, or even disable the EC timeout mechanism > altogether. Add a debugfs control to set the timeout to values other > than the EC-defined default, for more convenient debug and > development iteration. > > Signed-off-by: Evan Green (One minor nit aside) FWIW: Reviewed-by: Prashant Malani > --- > > Changes in v2: > - Update release version to 6.1 (Tzung-Bi) > - Reference EC_HOST_SLEEP_TIMEOUT_INFINITE (Tzung-Bi) > - Name the debugfs file suspend_timeout_ms (Prashant) > > Documentation/ABI/testing/debugfs-cros-ec | 22 +++++++++++++++++++++ > drivers/platform/chrome/cros_ec.c | 3 ++- > drivers/platform/chrome/cros_ec_debugfs.c | 3 +++ > include/linux/platform_data/cros_ec_proto.h | 1 + > 4 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/Documentation/ABI/testing/debugfs-cros-ec b/Documentation/ABI/testing/debugfs-cros-ec > index 1fe0add99a2a99..9f79c641b2d09f 100644 > --- a/Documentation/ABI/testing/debugfs-cros-ec > +++ b/Documentation/ABI/testing/debugfs-cros-ec > @@ -54,3 +54,25 @@ Description: > this feature. > > Output will be in the format: "0x%08x\n". > + > +What: /sys/kernel/debug//suspend_timeout_ms > +Date: August 2022 > +KernelVersion: 6.1 > +Description: > + Some ECs have a feature where they will track transitions to the > + a hardware-controlled sleep line, such as Intel's SLP_S0 line, > + in order to detect cases where a system failed to go into deep > + sleep states. The suspend_timeout file controls the amount of s/suspend_timeout/suspend_timeout_ms