diff options
author | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-07-18 08:09:12 +0300 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-07-20 04:22:58 +0300 |
commit | 7f95d2b68b9a4f6624438f2d7dbad01c157b92a6 (patch) | |
tree | 3862dc2c8e6f1bc755f4ef8ea2e9e6ccf5daea35 /drivers/platform/chrome | |
parent | 00eb36d528729692d418e53c832971a798f85ceb (diff) | |
download | linux-7f95d2b68b9a4f6624438f2d7dbad01c157b92a6.tar.xz |
platform/chrome: cros_ec_proto: return -EAGAIN when retries timed out
While EC_COMMS_STATUS_PROCESSING flag is still on after it tries
EC_COMMAND_RETRIES times for sending EC_CMD_GET_COMMS_STATUS,
cros_ec_wait_until_complete() doesn't return an error code.
Return -EAGAIN in the case instead.
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20220718050914.2267370-9-tzungbi@kernel.org
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r-- | drivers/platform/chrome/cros_ec_proto.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c index a6ad7f7956e6..9dec475edc84 100644 --- a/drivers/platform/chrome/cros_ec_proto.c +++ b/drivers/platform/chrome/cros_ec_proto.c @@ -167,6 +167,9 @@ static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev, uint32_t * return ret; } + if (i >= EC_COMMAND_RETRIES) + ret = -EAGAIN; + return ret; } |