Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp71756img; Wed, 20 Mar 2019 14:21:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCmn1DKXQ47OPDO5DffVS2q3/WNBPqcWbRXL8V00Kf+KCx1GJdHLJ4ZuJgWa3FMTwZx/1U X-Received: by 2002:aa7:8b0c:: with SMTP id f12mr9776744pfd.154.1553116916115; Wed, 20 Mar 2019 14:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553116916; cv=none; d=google.com; s=arc-20160816; b=ZLK6R3pkW/ScKNT17HXokNE/i01HKjx669UzbowWcHHheHngPpwgfL7xMTJM6YM7ve IAkRtVv//cebCzRafWZMlesFKONaXne+YfsP3snfDoCuGZw4X23DvMla7DvQAgIcowwp bG69eCDSw0EZXKlMR1jlFjLpgMTpmhK9McUBRaCJSr3vumvDDPhyBlTFKsCKkesUNaZr oaV5/cXMS4WEt2rjoC6nwTFt54hfC8o3u30gw4y4IsNQmSI2JT4P0Z/qBdRzst1T+sOu w2ZfFjC693DDyHG0VLB0mxIl3Z0/cHCbvZIzfcZYRdupHOQeqkE9j1kEgeONMwxiQo93 yiZQ== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zLFT8otiF3qbDJtenGoU8Taqeh/8zzCA8vs2YJoRSt8=; b=H+2oXCnPRu8098HdTE76O5hsV8FV8U1RhW1+GUnCAW4xFN5i4FIDpKY6zFIxlZIBWl Y62ivIemYoML5wOh7lRm6Ur+zc8Mb0g5YOu0VZ1mDw0O5C3zBhizZwbV5D2uDJdZaUtX 7G/hP3ezQsJfcgAqePMkD8CDmgIzJWWguoHnE/cgoHixSGbBQmfCxYYCctng6AIG4j48 nrCIKU0Wy3J11scgQG6vZRFuLNY9wWxxRIdOOFbtqsWlPQ+ep44Craq5k6yGNCVAFf70 3KUnZLo4Py4k1SGF6pVPaXvIr5fgdvMspcb4IdDEe+f5ToVSUrcCNB33Ty18QzBAU2Yx 7AFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="mJJ9Z1/+"; 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 q65si2533599pfi.185.2019.03.20.14.21.37; Wed, 20 Mar 2019 14:21:56 -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="mJJ9Z1/+"; 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 S1727573AbfCTVUv (ORCPT + 99 others); Wed, 20 Mar 2019 17:20:51 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46505 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727381AbfCTVUv (ORCPT ); Wed, 20 Mar 2019 17:20:51 -0400 Received: by mail-pf1-f196.google.com with SMTP id 9so2571292pfj.13 for ; Wed, 20 Mar 2019 14:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zLFT8otiF3qbDJtenGoU8Taqeh/8zzCA8vs2YJoRSt8=; b=mJJ9Z1/+rVg/MuUGQ6bx5SVptRSG5LbB1xlQ3x5rz7nLHVtTpFypZEAf7JUC/koc7H g5OnpOGfSglELiB7EDFQo4towHBY4QEX89KS6Q23/DdP2XCeX70OuGXmWsNNaANR2aTh OwW7Pp5SJrTWR9pAG3NI3OqDeXJaUwvHLQMcE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zLFT8otiF3qbDJtenGoU8Taqeh/8zzCA8vs2YJoRSt8=; b=jXYP1/qXkBPlG5EQV1dsXIaRM3FZIu6CusnurfIN6/U1EsWNgsZ8Smgq8Ge7GZabOe JebbcaDy8p1jUyJjhDy3fY8o0Awmu+QDoK31WREYFYXkobe1wkZP34/QcV2FBuvEj/vp zeDuNEAsseD+PwYV6aLAtLcWReEeNYB+A+nEJqyJ6noi8geYyFBTvmtF4ysx7xpIhFq3 k34J30j1k5YM7fzOLviT7OkegDtXAYGC1VCiBPCDLopd9giFpUM/dPSW57Z7at7PsDaj M/HRxQAkP4sbGKzE0GlbbhlGD3DwLU4jVFaF5+InNaS5qQ0i4g7Mpwzu10U1WWS8RzVC mPmw== X-Gm-Message-State: APjAAAX1wY5aojXEmTRfiaZTJo8u/W4pKXgL2UYdZlSbyePTrNX57/Vp Cm3mzcv7tmiAk+RnDGY3LmW0Og== X-Received: by 2002:a17:902:112c:: with SMTP id d41mr10264262pla.177.1553116850768; Wed, 20 Mar 2019 14:20:50 -0700 (PDT) Received: from evgreen2.mtv.corp.google.com ([2620:15c:202:201:ffda:7716:9afc:1301]) by smtp.gmail.com with ESMTPSA id u13sm5288609pfa.169.2019.03.20.14.20.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Mar 2019 14:20:50 -0700 (PDT) From: Evan Green To: Benson Leung , Enric Balletbo i Serra Cc: Furquan Shaikh , Rajat Jain , Evan Green , linux-kernel@vger.kernel.org, Guenter Roeck , Lee Jones Subject: [PATCH 0/2] platform/chrome: Add support for host sleep event command v1 Date: Wed, 20 Mar 2019 14:20:28 -0700 Message-Id: <20190320212030.43682-1-evgreen@chromium.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Chrome OS EC has an updated set of parameters for the host sleep event command. With the new parameters, the host can indicate a timeout along with suspend messages. Specifically S0ix suspend messages are supported now, though the host command format isn't specific to S0ix. When the EC sees an S0ix suspend host sleep event, it arms a timer for the specified number of milliseconds (or a sane per-board default baked into the EC). If the EC does not observe the platform's SLP_S0 line assert within the specified timeout, then the EC wakes the system. On resume, the EC reports the number of transitions seen on the SLP_S0 line. The high bit is used to report whether or not a timeout occurred. The number of transitions can then be used to detect cases of excessive housekeeping activities, where the system wakes up out of S0ix temporarily (unbeknownst to Linux), and then (hopefully) goes back to sleep. This mechanism helps in cases where the system attempted to suspend via S0ix, but due to driver bugs ended up suspending to a shallower idle state instead. In concert with additional changes that detect S0ix entry failures, this mechanism allows the system to quickly detect and report on incorrect suspend outcomes. Evan Green (2): mfd: cros_ec: Add host_sleep_event_v1 command platform/chrome: Add support for v1 of host sleep event drivers/mfd/cros_ec.c | 37 +++++++++++++--- drivers/platform/chrome/cros_ec_proto.c | 9 ++++ include/linux/mfd/cros_ec.h | 2 + include/linux/mfd/cros_ec_commands.h | 59 +++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 5 deletions(-) -- 2.20.1