From c81f28d3aeb4590de585d23ef5c9962262ef92db Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Fri, 10 Jan 2020 11:41:20 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1995602 Reviewed-by: Diana Z Reviewed-by: Brian Nemec --- chip/stm32/usb_spi.c | 3 --- 1 file changed, 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; -- cgit v1.2.1