cros_ec: Fix deadlock when EC is not responsive at probe
authorGwendal Grignou <gwendal@chromium.org>
Tue, 14 Feb 2017 19:58:01 +0000 (20:58 +0100)
committerBenson Leung <bleung@chromium.org>
Tue, 27 Jun 2017 15:22:39 +0000 (08:22 -0700)
commitd4da97e59e1004aa1a15dd75469def20cd84ab99
tree7aac14a0e6eb45f8d0db5e65db435d80e6483929
parenta27b8f31cb7929bfb8dc6ca3e6b7a0a39609d7f3
cros_ec: Fix deadlock when EC is not responsive at probe

When the EC is not responsive at probe, we try to get basic information
(protocol to use) later on through cros_xfer_cmd() call.
This patch makes sure there is no deadlock when re-probing the EC by
replacing call to cros_xfer_cmd() with send_command() in the function
cros_ec_get_host_command_version_mask(). Also, this patch adds the
function header indicating it must be called protected.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
drivers/platform/chrome/cros_ec_proto.c