lkml.org 
[lkml]   [2022]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] platform/chrome: cros_ec: Send host event for prepare/complete
On Fri, Jul 1, 2022 at 8:54 AM Tim Van Patten <timvp@google.com> 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@google.com>
> ---
>
> drivers/platform/chrome/cros_ec_lpc.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
> index 7677ab3c0ead9..783a0e56bf5f3 100644
> --- a/drivers/platform/chrome/cros_ec_lpc.c
> +++ b/drivers/platform/chrome/cros_ec_lpc.c
> @@ -534,19 +534,24 @@ 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");

I don't see why that logging noise is necessary and/or adds value. If
every driver did that, the entire kernel log would be polluted by
similar messages.

> +
> return cros_ec_suspend(ec_dev);
> }
>
> -static int cros_ec_lpc_resume(struct device *dev)
> +static void cros_ec_lpc_resume(struct device *dev)
> {
> struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
>
> - return cros_ec_resume(ec_dev);
> + cros_ec_resume(ec_dev);
> +
> + dev_info(dev, "EC resume completed\n");

Same here.

Guenter

> }
> #endif
>
> static const struct dev_pm_ops cros_ec_lpc_pm_ops = {
> - SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume)
> + .prepare = cros_ec_lpc_suspend,
> + .complete = cros_ec_lpc_resume
> };
>
> static struct platform_driver cros_ec_lpc_driver = {
> --
> 2.37.0.rc0.161.g10f37bed90-goog
>

\
 
 \ /
  Last update: 2022-07-01 19:01    [W:0.644 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site