summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@chromium.org>2021-02-11 22:32:21 +0300
committerBenson Leung <bleung@chromium.org>2021-02-12 00:18:46 +0300
commita59e12218c4f5498d5669a0ee0c725101ca89d52 (patch)
tree1eaa209db387aa2f8764d84c4f0ec1a74ead0cb4 /drivers/platform
parentb4b06c97729547d03a8f49c6774c8bd69150ea4d (diff)
downloadlinux-a59e12218c4f5498d5669a0ee0c725101ca89d52.tar.xz
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/chrome/cros_ec_typec.c1
1 files changed, 1 insertions, 0 deletions
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;