diff options
author | Jett Rink <jettrink@chromium.org> | 2020-01-10 11:41:20 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-28 23:14:34 +0000 |
commit | c81f28d3aeb4590de585d23ef5c9962262ef92db (patch) | |
tree | ea197cc4bf8fe4221ea271283c15e9552efc986e | |
parent | d2cd97bc1d2d070fa2cf2ab6345080b5605dc221 (diff) | |
download | chrome-ec-c81f28d3aeb4590de585d23ef5c9962262ef92db.tar.gz |
spi: respond to USB endpoint when SPI disabled
If the stm has its SPI bus disabled locally, then the
host request to enable or disable SPI would go unacknowledged
which would ultimately crash the stm32.
BRANCH=none
BUG=b:147353903
TEST=execute flash rom when C2D2 is not in SPI mode and watch
that C2D2 no longer crashes.
Change-Id: I05d6c1519b90932a9c883c013059446c2751c892
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1995602
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Brian Nemec <bnemec@chromium.org>
-rw-r--r-- | chip/stm32/usb_spi.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/chip/stm32/usb_spi.c b/chip/stm32/usb_spi.c index eaaaaf91d3..b560b55709 100644 --- a/chip/stm32/usb_spi.c +++ b/chip/stm32/usb_spi.c @@ -164,9 +164,6 @@ int usb_spi_interface(struct usb_spi_config const *config, setup.wLength != 0) return 1; - if (!config->state->enabled_device) - return 1; - switch (setup.bRequest) { case USB_SPI_REQ_ENABLE: config->state->enabled_host = 1; |