Skip to contentSkip to conversation

platform/chrome: cros_ec_typec: Flush pending work

PATCH Applied Prashant Malani 2 participants 2 messages Feb 11, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/chrome: cros_ec_typec: Flush pending work

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.

---
 drivers/platform/chrome/cros_ec_typec.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/chrome/cros_ec_typec.c +1 -0
index db83c03ae5cd..2fac95e7a455 100644
@@ -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;
Signature · 1 line
2.30.0.478.g8a0d178c01-goog
Applied
#1 lore raw
Quoted 4 lines · Prashant Malani

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,

Signature · 7 lines
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
[email protected]
Chromium OS Project
[email protected]