linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] platform/chrome: cros_ec: Notify the PM of wake events during resume
@ 2022-09-12 22:47 Jameson Thies
  2022-09-13  3:14 ` Tzung-Bi Shih
  0 siblings, 1 reply; 3+ messages in thread
From: Jameson Thies @ 2022-09-12 22:47 UTC (permalink / raw)
  To: chrome-platform
  Cc: linux-kernel, pmalani, bleung, groeck, tzungbi, Jameson Thies

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>
---

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(-)

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index 8aace50d446d..110df0fd4b00 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -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);
+	}
 }
 
 /**
-- 
2.37.2.789.g6183377224-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] platform/chrome: cros_ec: Notify the PM of wake events during resume
  2022-09-12 22:47 [PATCH v2] platform/chrome: cros_ec: Notify the PM of wake events during resume Jameson Thies
@ 2022-09-13  3:14 ` Tzung-Bi Shih
  2022-09-13 17:16   ` Prashant Malani
  0 siblings, 1 reply; 3+ messages in thread
From: Tzung-Bi Shih @ 2022-09-13  3:14 UTC (permalink / raw)
  To: Jameson Thies; +Cc: chrome-platform, linux-kernel, pmalani, bleung, groeck

On Mon, Sep 12, 2022 at 10:47:45PM +0000, Jameson Thies wrote:
> 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"?

> Signed-off-by: Jameson Thies <jthies@google.com>
> Reviewed-by: Prashant Malani <pmalani@chromium.org>

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] platform/chrome: cros_ec: Notify the PM of wake events during resume
  2022-09-13  3:14 ` Tzung-Bi Shih
@ 2022-09-13 17:16   ` Prashant Malani
  0 siblings, 0 replies; 3+ messages in thread
From: Prashant Malani @ 2022-09-13 17:16 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Jameson Thies, chrome-platform, linux-kernel, bleung, groeck

On Mon, Sep 12, 2022 at 8:14 PM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
>
> On Mon, Sep 12, 2022 at 10:47:45PM +0000, Jameson Thies wrote:
> > 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"?
>
> > Signed-off-by: Jameson Thies <jthies@google.com>
> > Reviewed-by: Prashant Malani <pmalani@chromium.org>
>
> 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.

> 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/20220913055316.23050-2-shruthi.sanil@intel.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-13 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 22:47 [PATCH v2] platform/chrome: cros_ec: Notify the PM of wake events during resume Jameson Thies
2022-09-13  3:14 ` Tzung-Bi Shih
2022-09-13 17:16   ` Prashant Malani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).