Skip to content

Commit a59e122

Browse files
Prashant Malanibleungatchromium
authored andcommitted
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. Signed-off-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20210211193221.610867-1-pmalani@chromium.org Signed-off-by: Benson Leung <bleung@chromium.org>
1 parent b4b06c9 commit a59e122

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/platform/chrome/cros_ec_typec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,7 @@ static int cros_ec_typec_event(struct notifier_block *nb,
10311031
{
10321032
struct cros_typec_data *typec = container_of(nb, struct cros_typec_data, nb);
10331033

1034+
flush_work(&typec->port_work);
10341035
schedule_work(&typec->port_work);
10351036

10361037
return NOTIFY_OK;

0 commit comments

Comments
 (0)