linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_typec: Flush pending work
@ 2021-02-11 19:32 Prashant Malani
  2021-02-11 21:22 ` Benson Leung
  0 siblings, 1 reply; 2+ messages in thread
From: Prashant Malani @ 2021-02-11 19:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prashant Malani, Benson Leung, Enric Balletbo i Serra, Guenter Roeck

When a PD notifier event arrives, a new work event won't be enqueued if
the current one hasn't completed. This could lead to dropped events.

So, flush any pending work before scheduling the new instance.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_ec_typec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index db83c03ae5cd..2fac95e7a455 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -1031,6 +1031,7 @@ static int cros_ec_typec_event(struct notifier_block *nb,
 {
 	struct cros_typec_data *typec = container_of(nb, struct cros_typec_data, nb);
 
+	flush_work(&typec->port_work);
 	schedule_work(&typec->port_work);
 
 	return NOTIFY_OK;
-- 
2.30.0.478.g8a0d178c01-goog


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

* Re: [PATCH] platform/chrome: cros_ec_typec: Flush pending work
  2021-02-11 19:32 [PATCH] platform/chrome: cros_ec_typec: Flush pending work Prashant Malani
@ 2021-02-11 21:22 ` Benson Leung
  0 siblings, 0 replies; 2+ messages in thread
From: Benson Leung @ 2021-02-11 21:22 UTC (permalink / raw)
  To: linux-kernel, Prashant Malani
  Cc: Guenter Roeck, Enric Balletbo i Serra, bleung

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

On Thu, 11 Feb 2021 11:32:21 -0800, Prashant Malani wrote:
> When a PD notifier event arrives, a new work event won't be enqueued if
> the current one hasn't completed. This could lead to dropped events.
> 
> So, flush any pending work before scheduling the new instance.

Applied, thanks!

[1/1] platform/chrome: cros_ec_typec: Flush pending work
      commit: a59e12218c4f5498d5669a0ee0c725101ca89d52

Best regards,
-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2021-02-11 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 19:32 [PATCH] platform/chrome: cros_ec_typec: Flush pending work Prashant Malani
2021-02-11 21:22 ` Benson Leung

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