From 8db7e6702b58f99d0e5be5311772b31c16a61633 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Mon, 26 Oct 2015 11:44:00 -0700 Subject: libpayload: usbmsc: Add small delay during initialization to fix CZ60 We found that some SanDisk Cruizer Glide CZ60 sticks (confirmed on 16GB and 64GB versions) have a problem responding to our first GET_MAX_LUNS request right after they received their SET_CONFIGURATION. They will continually return a NAK until the host gives up (which is 2 user-noticable seconds for us). Adding a small delay of about 15us seems to be enough to fix the issue, but let's do 50 to be save. Confirmed with both MT8173 and Intel LynxPoint XHCI controllers. BRANCH=None BUG=chrome-os-partner:45473 TEST=No notable delay before detecting stick on Oak and Falco. Change-Id: Ib03944d6484de0ccecbb9922d22666f54c9d53dd Signed-off-by: Patrick Georgi Original-Commit-Id: 589f19a901275fb8b00de4595763a7d577bed524 Original-Change-Id: I95c79fe40d3ad79f37ce2eb586836e5de55be454 Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/308980 Original-Reviewed-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/12229 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- payloads/libpayload/drivers/usb/usbmsc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c index ccd693a84d..17313cf88e 100644 --- a/payloads/libpayload/drivers/usb/usbmsc.c +++ b/payloads/libpayload/drivers/usb/usbmsc.c @@ -660,6 +660,9 @@ usb_msc_init (usbdev_t *dev) MSC_INST (dev)->bulk_in->endpoint, MSC_INST (dev)->bulk_out->endpoint); + /* Some sticks need a little more time to get ready after SET_CONFIG. */ + udelay(50); + initialize_luns (dev); usb_debug (" has %d luns\n", MSC_INST (dev)->num_luns); -- cgit v1.2.3