diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2021-06-18 13:46:56 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-18 22:47:22 +0000 |
commit | a6e62a3020e1f6d53880d91760073c4f91a63bef (patch) | |
tree | 4e79f17b97acb8477a0a826b049cb5bfecb4ac70 /board/cr50/usb_spi.c | |
parent | f1dad7730feb3e0a8ab37651e11fd3aad1b74938 (diff) | |
download | chrome-ec-a6e62a3020e1f6d53880d91760073c4f91a63bef.tar.gz |
usb_spi: prevent potential loss of upstream traffic
Code placing data on the upstream usb_spi queue does not check if
there is enough room on the queue, which could result in silent
dropping of data when the upstream queue is busy.
This is not a big deal with Raiden protocol V1 where USB packets to
the host are sent one at a time, but becomes a problem if the DUT
sends multiple USB packets without waiting for the host.
Adding a sleep in the loop waiting for the room in the queue to free
up seems an appropriate solution, since the AP is held in reset at
this point and there is no much activity happening on Cr50.
Experiments have shown that with 2KB PDU size the total wait time
while reading a 16M flash does not exceed 30 ms when this fix is
deployed.
BUG=b:79492818
TEST=with the rest of the patches applied observed successful flashrom
operations running Raiden protocol version V2. Without this patch
there were periodic drops of data sent by DUT.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I73fdfdda09837891dc1db2453098ec1d219c4553
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2973573
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Diffstat (limited to 'board/cr50/usb_spi.c')
0 files changed, 0 insertions, 0 deletions