|
|
@@ -297,12 +297,12 @@ static int msc_read10_retry(struct usb_msc *m, unsigned int lba,
|
|
|
unsigned int count, void *buf)
|
|
|
{
|
|
|
unsigned int i, t0 = get_ticks_ms();
|
|
|
- int probe_only = msc_probe_only && m->first_read;
|
|
|
+ int probe_only = msc_probe_only;
|
|
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
int r;
|
|
|
|
|
|
- if (i == 0 && m->first_read)
|
|
|
+ if (i == 0 && (m->first_read || probe_only))
|
|
|
m->timeout_ms = probe_only ? MSC_PROBE_MS :
|
|
|
MSC_FIRST_READ_MS;
|
|
|
r = msc_read10(m, lba, count, buf);
|
|
|
@@ -318,12 +318,16 @@ static int msc_read10_retry(struct usb_msc *m, unsigned int lba,
|
|
|
serial_puts(SERIAL_COM1, " ms\n");
|
|
|
}
|
|
|
}
|
|
|
- if (r == 0)
|
|
|
+ if (r == 0) {
|
|
|
+ if (probe_only)
|
|
|
+ m->timeout_ms = MSC_TIMEOUT_MS;
|
|
|
return 0;
|
|
|
+ }
|
|
|
if (probe_only) {
|
|
|
- /* Boot background scan: do not spend the reset and
|
|
|
- * retry chain on a device that did not answer its
|
|
|
- * first read. `storage` will try the full path. */
|
|
|
+ /* Best-effort probe: do not spend the reset and retry
|
|
|
+ * chain on a device that did not answer. `storage`
|
|
|
+ * will try the full path. */
|
|
|
+ m->timeout_ms = MSC_TIMEOUT_MS;
|
|
|
return -1;
|
|
|
}
|
|
|
/* Only a completed command with a non-zero CSW status has
|
|
|
@@ -339,6 +343,8 @@ static int msc_read10_retry(struct usb_msc *m, unsigned int lba,
|
|
|
msc_reconfigure(m);
|
|
|
msc_delay(10);
|
|
|
}
|
|
|
+ if (probe_only)
|
|
|
+ m->timeout_ms = MSC_TIMEOUT_MS;
|
|
|
return -1;
|
|
|
}
|
|
|
|