]> git.baikalelectronics.ru Git - kernel.git/commit
platform/chrome: cros_ec_rpmsg: Fix race with host event
authorPi-Hsun Shih <pihsun@chromium.org>
Fri, 14 Feb 2020 08:26:38 +0000 (16:26 +0800)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 2 Mar 2020 10:04:04 +0000 (11:04 +0100)
commit17829d6606d13c503617cdf8593fa7ac425db1c1
tree7cce4a5be5e5b40d43071d069b34527143904014
parentbd7c96b1ee20fc932d785a09ea98aa8f162d8899
platform/chrome: cros_ec_rpmsg: Fix race with host event

Host event can be sent by remoteproc by any time, and
cros_ec_rpmsg_callback would be called after cros_ec_rpmsg_create_ept.
But the cros_ec_device is initialized after that, which cause host event
handler to use cros_ec_device that are not initialized properly yet.

Fix this by don't schedule host event handler before cros_ec_register
returns. Instead, remember that we have a pending host event, and
schedule host event handler after cros_ec_register.

Fixes: a9b9556b0306 ("platform/chrome: cros_ec_rpmsg: Fix race with host command when probe failed.")
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
drivers/platform/chrome/cros_ec_rpmsg.c