From: Gwendal Grignou Date: Fri, 22 Jan 2021 05:46:37 +0000 (-0800) Subject: platform/chrome: cros_ec: Call interrupt bottom half at probe time X-Git-Tag: v5.12-rc1~112^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4daeb395f1754340927d8d58269593e4e3b6afcd;p=thirdparty%2Fkernel%2Flinux.git platform/chrome: cros_ec: Call interrupt bottom half at probe time While the AP was powered off, the EC may have send messages. If the message is not serviced within 3s, the EC stops sending message. Unlock the EC by purging stale messages at probe time. Signed-off-by: Gwendal Grignou Signed-off-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20210122054637.1422289-3-gwendal@chromium.org --- diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index bf76a6c49c95e..fc5aa1525d13c 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -283,6 +283,13 @@ int cros_ec_register(struct cros_ec_device *ec_dev) dev_info(dev, "Chrome EC device registered\n"); + /* + * Unlock EC that may be waiting for AP to process MKBP events. + * If the AP takes to long to answer, the EC would stop sending events. + */ + if (ec_dev->mkbp_event_supported) + cros_ec_irq_thread(0, ec_dev); + return 0; } EXPORT_SYMBOL(cros_ec_register);