Skip to contentSkip to conversation

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

PATCH Superseded Jameson Thies 3 participants 3 messages Sep 12, 2022 – Sep 13, 2022

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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

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

---

Changes since v1:
- Updated wording in commit message from "Log" to "Notify PM of".

---
 drivers/platform/chrome/cros_ec.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec.c +7 -1
index 8aace50d446d..110df0fd4b00 100644
@@ -349,10 +349,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);
+	}
 }
 
 /**
Signature · 1 line
2.37.2.789.g6183377224-goog
maintainer
#1 lore raw
Quoted 2 lines · Jameson Thies

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

Could you add some more details about "why"?

Quoted 2 lines

I didn't see where the R-b tag comes from which has been attached since v1. You shouldn't attach the tag even if the patch may have been reviewed somewhere but not in the mailing list.

#2 lore raw
Quoted 5 lines · Tzung-Bi Shih
Quoted 2 lines · Jameson Thies

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

Quoted 7 lines

Could you add some more details about "why"?

Quoted 2 lines

I didn't see where the R-b tag comes from which has been attached since v1.

I asked Jameson to do so, after having reviewed the patch off list.

Quoted 2 lines

You shouldn't attach the tag even if the patch may have been reviewed somewhere but not in the mailing list.

That is not a requirement (at least, it is not stated anywhere in kernel documentation).
There are plenty of examples of patches being uploaded after being reviewed. Here
is just 1 recent example [1] but I'm sure you can find plenty more.

[1] https://lore.kernel.org/linux-usb/[email protected]/