summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-03-10 04:06:42 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-03-10 04:06:42 +0100
commit9f25f9504af4f42cbcd9b3047b338c95c69c4ea5 (patch)
treed8f2e533c0e4ac2b2895347b0c668843335994ac
parentcc02f96ed9efe941aed56e71b2fc42c6f98936ed (diff)
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.
-rw-r--r--sys/src/cmd/nusb/disk/disk.c4
1 files changed, 3 insertions, 1 deletions
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.