Skip to content

Commit

Permalink
mfd: cros_ec: Check for mkbp events on resume only if supported.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Marek Szyprowski <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
RaviChandra Sadineni authored and Lee Jones committed Oct 23, 2018
1 parent 4ded11d commit 61cc15d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mfd/cros_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 61cc15d

Please sign in to comment.