From: RaviChandra Sadineni Date: Mon, 20 Aug 2018 15:34:19 +0000 (-0700) Subject: mfd: cros_ec: Check for mkbp events on resume only if supported. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=61cc15dac01ae84281222452e338ca060179d8b1;p=linux.git mfd: cros_ec: Check for mkbp events on resume only if supported. Currently on every resume we check for mkbp events and notify the clients. This helps in identifying the wakeup sources. But on devices that do not support mkbp protocol, we might end up querying key state of the keyboard in a loop which blocks the resume. Instead check for events only if mkbp is supported. Signed-off-by: RaviChandra Sadineni Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c index 65a9757a6d214..fe6f83766144f 100644 --- a/drivers/mfd/cros_ec.c +++ b/drivers/mfd/cros_ec.c @@ -218,7 +218,8 @@ EXPORT_SYMBOL(cros_ec_suspend); static void cros_ec_report_events_during_suspend(struct cros_ec_device *ec_dev) { - while (cros_ec_get_next_event(ec_dev, NULL) > 0) + while (ec_dev->mkbp_event_supported && + cros_ec_get_next_event(ec_dev, NULL) > 0) blocking_notifier_call_chain(&ec_dev->event_notifier, 1, ec_dev); }