• Pi-Hsun Shih's avatar
    platform/chrome: cros_ec_rpmsg: Fix race with host event · f775ac78
    Pi-Hsun Shih authored
    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: 71cddb70 ("platform/chrome: cros_ec_rpmsg: Fix race with host command when probe failed.")
    Signed-off-by: default avatarPi-Hsun Shih <pihsun@chromium.org>
    Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
    f775ac78
cros_ec_rpmsg.c 7.63 KB