Re: [PATCH v2] platform/chrome: cros_ec: Send host event for prepare/complete

From: Prashant Malani
Date: Thu Jul 14 2022 - 14:35:04 EST


HI Tim,

On Wed, Jul 6, 2022 at 7:51 PM Tim Van Patten <timvp@xxxxxxxxxx> wrote:
>
> Update cros_ec_lpc_pm_ops to call cros_ec_lpc_suspend() during PM
> .prepare() and cros_ec_lpc_resume() during .complete. This allows the
> EC to log entry/exit of AP's suspend/resume more accurately.
>
> Signed-off-by: Tim Van Patten <timvp@xxxxxxxxxx>
> ---
>
> Changes in v2:
> - Include cros_ec_resume() return value in dev_info() output.
> - Guard setting .prepare/.complete with #ifdef CONFIG_PM_SLEEP.
>
> drivers/platform/chrome/cros_ec_lpc.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
> index 7677ab3c0ead9..ce49fbc4ed2e1 100644
> --- a/drivers/platform/chrome/cros_ec_lpc.c
> +++ b/drivers/platform/chrome/cros_ec_lpc.c
> @@ -534,19 +534,27 @@ static int cros_ec_lpc_suspend(struct device *dev)
> {
> struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
>
> + dev_info(dev, "Prepare EC suspend\n");

This patch is doing 2 things:
1. Changing the timing of cros_ec_lpc_suspend()/resume() invocation.
2. Adding print logs for these callbacks.

Whether 2.) is necessary is already being discussed, so I won't
comment on that, but it sounds
like this should be 2 different patches.

Also, please explain what is wrong with "Previously, those events were sent when
suspend/resume were already in progress." IOW, what issue is this
solving, besides
better ordering of EC logs.

BR,

-Prashant