From: Prashant Malani Date: Thu, 11 Feb 2021 19:32:21 +0000 (-0800) Subject: platform/chrome: cros_ec_typec: Flush pending work X-Git-Tag: v5.12-rc1~112^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a59e12218c4f5498d5669a0ee0c725101ca89d52;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20210211193221.610867-1-pmalani@chromium.org Signed-off-by: Benson Leung --- diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index db83c03ae5cda..2fac95e7a4551 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;