Patch "platform/chrome: cros_ec: Notify the PM of wake events during resume" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    platform/chrome: cros_ec: Notify the PM of wake events during resume

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     platform-chrome-cros_ec-notify-the-pm-of-wake-events.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cda8f32a3c5c75fa4f074f74dc77918721aab3ab
Author: Jameson Thies <jthies@xxxxxxxxxx>
Date:   Tue Sep 13 20:49:54 2022 +0000

    platform/chrome: cros_ec: Notify the PM of wake events during resume
    
    [ 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@xxxxxxxxxx>
    Reviewed-by: Prashant Malani <pmalani@xxxxxxxxxxxx>
    Reviewed-by: Benson Leung <bleung@xxxxxxxxxxxx>
    Signed-off-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220913204954.2931042-1-jthies@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index 4f0390b10cd3..9664e13ded59 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -353,10 +353,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);
+	}
 }
 
 /**



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux