Re: [PATCH v2] platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs

From: Prashant Malani
Date: Thu Aug 18 2022 - 13:25:58 EST


On Thu, Aug 18, 2022 at 8:29 AM Evan Green <evgreen@xxxxxxxxxxxx> 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 <evgreen@xxxxxxxxxxxx>
(One minor nit aside) FWIW:
Reviewed-by: Prashant Malani <pmalani@xxxxxxxxxxxx>

> ---
>
> 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/<cros-ec-device>/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