From 9f25f9504af4f42cbcd9b3047b338c95c69c4ea5 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 10 Mar 2013 04:06:42 +0100 Subject: [PATCH] nusb/disk: add small delay after unit start command (for thinkpad sdcard reader) diskparts fails on thinkpad x200 sdcard reader if we dont give the unit some time to startup. the device took about 100ms to become ready so status poll loop with a long timeout would be overkill. --- sys/src/cmd/nusb/disk/disk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/src/cmd/nusb/disk/disk.c b/sys/src/cmd/nusb/disk/disk.c index 0bffaa0ba..b9bbe6cf6 100644 --- a/sys/src/cmd/nusb/disk/disk.c +++ b/sys/src/cmd/nusb/disk/disk.c @@ -345,8 +345,10 @@ umsinit(void) if(SRready(lun) < 0 && SRready(lun) < 0 && SRready(lun) < 0) dprint(2, "disk: lun %d not ready\n", i); - if((lun->inquiry[0] & 0x1F) == 0) + if((lun->inquiry[0] & 0x1F) == 0){ SRstart(lun, 1); + sleep(250); + } /* * we ignore the device type reported by inquiry.