lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 334/390] platform/chrome: cros_ec: Notify the PM of wake events during resume
    Date
    From: Jameson Thies <jthies@google.com>

    [ Upstream commit 8edd2752b0aa498b3a61f3caee8f79f7e0567fad ]

    cros_ec_handle_event in the cros_ec driver can notify the PM of wake
    events. When a device is suspended, cros_ec_handle_event will not check
    MKBP events. Instead, received MKBP events are checked during resume by
    cros_ec_report_events_during_suspend. But
    cros_ec_report_events_during_suspend cannot notify the PM if received
    events are wake events, causing wake events to not be reported if
    received while the device is suspended.

    Update cros_ec_report_events_during_suspend to notify the PM of wake
    events during resume by calling pm_wakeup_event.

    Signed-off-by: Jameson Thies <jthies@google.com>
    Reviewed-by: Prashant Malani <pmalani@chromium.org>
    Reviewed-by: Benson Leung <bleung@chromium.org>
    Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
    Link: https://lore.kernel.org/r/20220913204954.2931042-1-jthies@google.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/platform/chrome/cros_ec.c | 8 +++++++-
    1 file changed, 7 insertions(+), 1 deletion(-)

    diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
    index c4de8c4db193..5a622666a075 100644
    --- a/drivers/platform/chrome/cros_ec.c
    +++ b/drivers/platform/chrome/cros_ec.c
    @@ -332,10 +332,16 @@ EXPORT_SYMBOL(cros_ec_suspend);

    static void cros_ec_report_events_during_suspend(struct cros_ec_device *ec_dev)
    {
    + bool wake_event;
    +
    while (ec_dev->mkbp_event_supported &&
    - cros_ec_get_next_event(ec_dev, NULL, NULL) > 0)
    + cros_ec_get_next_event(ec_dev, &wake_event, NULL) > 0) {
    blocking_notifier_call_chain(&ec_dev->event_notifier,
    1, ec_dev);
    +
    + if (wake_event && device_may_wakeup(ec_dev->dev))
    + pm_wakeup_event(ec_dev->dev, 0);
    + }
    }

    /**
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-10-24 15:46    [W:4.670 / U:0.532 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site