diff options
author | Ting Shen <phoenixshen@google.com> | 2022-09-29 12:26:11 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-30 05:55:47 +0000 |
commit | 6f52fb294a8b0e5fb1d2aadad5e3c3b24911a9d0 (patch) | |
tree | 353f7d17ce098d7def5f38ff17689d9efd1d29d9 | |
parent | c7bec9f7bbf771871eea44df0bf59bb900d64461 (diff) | |
download | chrome-ec-6f52fb294a8b0e5fb1d2aadad5e3c3b24911a9d0.tar.gz |
bmi3xx: fix watchdog warning during fifo processing
The `break` lines inside the nested loop of `bmi3_parse_fifo_data`
does not work as intended. it should either exit the outer loop or
increase the `fifo_index`, otherwise it becomes an infinite loop.
BUG=b:248197142
TEST=run sw sync on tentacruel, no watchdog warning on uart console
BRANCH=none
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: I1c762bbfa71f763e65f04b82a9e61e210f9e94c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3928385
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Code-Coverage: Eric Yilun Lin <yllin@google.com>
Code-Coverage: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r-- | driver/accelgyro_bmi3xx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/driver/accelgyro_bmi3xx.c b/driver/accelgyro_bmi3xx.c index cf2bd0b3a2..38c23f4942 100644 --- a/driver/accelgyro_bmi3xx.c +++ b/driver/accelgyro_bmi3xx.c @@ -265,14 +265,17 @@ static void bmi3_parse_fifo_data(struct motion_sensor_t *s, * 0x8000. */ if (fifo_frame->data[fifo_index] == 0x8000) - break; + return; /* * In case the frame has been cut, FIFO was * greater than our buffer. + * When a frame is only partially read out, it + * is retransmitted at the next readout. + * No need to process it here. */ if (fifo_size < BMI3_FIFO_ENTRY) - break; + return; /* Frame is complete, but may have no data. */ fifo_size -= BMI3_FIFO_ENTRY; |