Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp79051img; Thu, 21 Mar 2019 14:33:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZBZT83exDhZVwflWVMRVpPOj7C7b9XPltGbucsgBPPdFLOXkLzQMx1TPlRRfo2HjDDGsQ X-Received: by 2002:a17:902:2b8b:: with SMTP id l11mr5985604plb.18.1553203991084; Thu, 21 Mar 2019 14:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553203991; cv=none; d=google.com; s=arc-20160816; b=za5hYMZcYGRiTAL0R2G9lY+Gzcbziet0TbllU5LuOGgIH7rqbHhKarHVjXP0Q32Fy6 bsz+lDyQ8bnveaQ7li/JRXB/9HzfMYpDC9enlQVe0a1AP3QAVVkvxn690l6QVTwP1lyj BEqfFReB8n5j9eJo1J4Z55kr3tNkgIQvodtEGiGZD2BdIYKdC3j6f7llCTUbZpwr2gbD bqw2UtrZFbN5tGoFlz+7NRDafhP8vApfFPTjw8NOJ/vxWzvrRH4hmhzAOfSaYnQ1bPOh AGhhTq2eA7gphkSMDHAmE0hux318Q6j4egJR17Zk86tgtowA73EfxBeu2r6apFenvS4D Td3w== 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=K5qEJIfaP1FU+TlftVfWGQJyiXvp5tk0HeUMOFbMHTs=; b=Fi8Eji5GHApAcgAmvQIDFO8kRRACA/stgKqhmRS44UoYy0pTRwhvfNXRlKdkvITUKP c0rKGqgj+Mse6oyKkJskj7+Dls0l+08pJC4Xm+6xxWUo3AewPukhEjmsAzNyms010Lm4 tCRCDU45Zlw2kefJN9FgnflZh86vNcvr8NEOP/UJKMrsNCXTfhrrd6rhYtwaXkfKxNqj ZbprwWGSdqJMBDJIO/e2HFkb4CcFirI8xzhDLyreFPXD/j2N05V04TN9/0RH/NL/9D+r 6OtaY03Hl3SdWSb6vSMZ9c/e0W7lPJlFOfJf61gfGR0Kn88ZRu2g6XdJEmy/mMoq3gMa ngfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VCsJA9n3; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j26si4826243pff.289.2019.03.21.14.32.51; Thu, 21 Mar 2019 14:33:11 -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=@gmail.com header.s=20161025 header.b=VCsJA9n3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727168AbfCUVbk (ORCPT + 99 others); Thu, 21 Mar 2019 17:31:40 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:45661 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfCUVbj (ORCPT ); Thu, 21 Mar 2019 17:31:39 -0400 Received: by mail-qk1-f195.google.com with SMTP id z76so14387qkb.12 for ; Thu, 21 Mar 2019 14:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=K5qEJIfaP1FU+TlftVfWGQJyiXvp5tk0HeUMOFbMHTs=; b=VCsJA9n3CjybgQtvH6n8StUZl06dN+iBu9VBu3tEVR21Y+o9uYRAtJiSGOwKCTBA83 J5HEaz/PY5SWF/vIQ8RsaiJWiGRHZTmqCdD63pPgcKiGo+GC3wlKOwMgfXSjBFoDW/So L3fAdTRz0ObGDB82qnxEqHcPGaC5Y0i1icgRpxd6uiz/Tgix+TwxIcvwIXwC0oaZP3Wz HxKDdp+oGZDqizGOAEiPaOSlm32wmqFkbhwMaDCtfgvS1wpmSio0Vsu6MXUCjFUpwqC+ hSzGRWd0lFfbpnCFYFJmgaDK+r/arXQP3LbuqURnkA6IlRAgynv0pirb/d7J285c0QMN cbVQ== 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=K5qEJIfaP1FU+TlftVfWGQJyiXvp5tk0HeUMOFbMHTs=; b=FijGfl3vlIHFFqJtQ7vXBdEZXyet7+w58Om83TuIB0Kt6Cx1rG3Y1jyuBTgoHbmAFp uf+DrSG7OyUgr3uXSRIYztRSk5QdQsczZqHsn5suLsBuXD1CQxg763Pfcbh5n+gqj7+T JgM4HRBQeNol0hM1BuOgxKEnhqU0fLdXzknzdF6yrQGolVFJ44c5G+YWIpWfO5ICnXmk rMYL8mvZJvDAEsANxi39sX13TzBK0nizXXvZjBjDjjRFSNtyQDEgBmE/h/w3tHoZSo0u t2LsdxjZ3J43IoWeRILcrSQ/dKjHORm7Q0g2fErrGovoCj94ZeNN/EVKgCM8dOPS3mAx FOXQ== X-Gm-Message-State: APjAAAUMUbkfIgzmJxBMEXrICJaDUXjA2WB4NIFVAH8U3W00Qy2NQN3X 8RO1t5imeNAAkxCSOnMAoSMWdPeM+7Kg0K7Hh/lPoOFH X-Received: by 2002:a37:47cb:: with SMTP id u194mr846211qka.358.1553203898505; Thu, 21 Mar 2019 14:31:38 -0700 (PDT) MIME-Version: 1.0 References: <20190320212030.43682-1-evgreen@chromium.org> <20190320212030.43682-2-evgreen@chromium.org> In-Reply-To: <20190320212030.43682-2-evgreen@chromium.org> From: Enric Balletbo Serra Date: Thu, 21 Mar 2019 22:31:27 +0100 Message-ID: Subject: Re: [PATCH 1/2] mfd: cros_ec: Add host_sleep_event_v1 command To: Evan Green Cc: Benson Leung , Enric Balletbo i Serra , Furquan Shaikh , Rajat Jain , linux-kernel , Guenter Roeck , Lee Jones 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 Hi Evan,Thanks for sending this upstream, one comment below. Missatge de Evan Green del dia dc., 20 de mar=C3=A7 2019 a les 22:24: > > Introduce the command and response structures for the second revision > of the host sleep event. These structures are part of a new EC change > that enables detection of failure to enter S0ix. The EC waits a > kernel-specified timeout (or a default amount of time) for the S0_SLP > pin to change, and wakes the system if that change does not occur in > time. > > Signed-off-by: Evan Green > > --- > > include/linux/mfd/cros_ec_commands.h | 59 ++++++++++++++++++++++++++++ We're trying to sync kernel cros_ec_commands.h with the EC protocol at https://chromium.googlesource.com/chromiumos/platform/ec/+/master/include/e= c_commands.h Gwendal send a first patch [1] and a second version will be sent soon. I don't see these definitions in the mentioned patch neither the master ec_commands.h from the EC firmware repository. Is this a feature that didn't land in the EC firmware yet? [1] https://lkml.org/lkml/2019/2/27/723 Thanks, Enric > 1 file changed, 59 insertions(+) > > diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cro= s_ec_commands.h > index fc91082d4c35..4db1240c28a8 100644 > --- a/include/linux/mfd/cros_ec_commands.h > +++ b/include/linux/mfd/cros_ec_commands.h > @@ -2729,6 +2729,65 @@ struct ec_params_host_sleep_event { > uint8_t sleep_event; > } __packed; > > +/* > + * Use a default timeout value (CONFIG_SLEEP_TIMEOUT_MS) for detecting s= leep > + * transition failures > + */ > +#define EC_HOST_SLEEP_TIMEOUT_DEFAULT 0 > + > +/* Disable timeout detection for this sleep transition */ > +#define EC_HOST_SLEEP_TIMEOUT_INFINITE 0xFFFF > + > +struct ec_params_host_sleep_event_v1 { > + /* The type of sleep being entered or exited. */ > + uint8_t sleep_event; > + > + /* Padding */ > + uint8_t reserved; > + union { > + /* Parameters that apply for suspend messages. */ > + struct { > + /* > + * The timeout in milliseconds between when this = message > + * is received and when the EC will declare sleep > + * transition failure if the sleep signal is not > + * asserted. > + */ > + uint16_t sleep_timeout_ms; > + } suspend_params; > + > + /* Reserved space for non-suspend commands. */ > + uint16_t reserved; > + } u; > +} __packed; > + > +/* A timeout occurred when this bit is set */ > +#define EC_HOST_RESUME_SLEEP_TIMEOUT 0x80000000 > + > +/* > + * The mask defining which bits correspond to the number of sleep transi= tions, > + * as well as the maximum number of suspend line transitions that will b= e > + * reported back to the host. > + */ > +#define EC_HOST_RESUME_SLEEP_TRANSITIONS_MASK 0x7FFFFFFF > + > +struct ec_response_host_sleep_event_v1 { > + union { > + /* Response fields that apply for resume messages. */ > + struct { > + /* > + * The number of sleep power signal transitions t= hat > + * occurred since the suspend message. The high b= it > + * indicates a timeout occurred. > + */ > + uint32_t sleep_transitions; > + } resume_response; > + > + /* Padding for non-resume responses. */ > + uint32_t reserved; > + } u; > +} __packed; > + > /***********************************************************************= ******/ > /* Smart battery pass-through */ > > -- > 2.20.1 >