usb_stor_BBB_transport: Do not delay when not required
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Fri, 10 Aug 2012 16:27:11 +0000 (18:27 +0200)
committerMarek Vasut <marex@denx.de>
Sat, 1 Sep 2012 14:21:52 +0000 (16:21 +0200)
commit3e8581bb95899e21b01d86e9fe5ad7358bbef142
tree0e02aae8ec843575aea8fc8bbdddf42a1a4a0bfb
parent4bee5c83ea46b5c7a5670f7decd6ba2515483d9c
usb_stor_BBB_transport: Do not delay when not required

There is a 5-ms delay in usb_stor_BBB_transport, which occurs every 10 kiB of
data for fragmented fatload usb, i.e. roughly 500 ms of delay per MiB. This adds
up to quite a bit of delay if you're loading a large ramdisk.

The purpose of this delay should be to debounce the 5-V/100-mA USB power up.
This patch skips the delay if the device has already been queried as ready.

Signed-off-by: Jim Shimer <mgi2475@motorola.com>
Rework following the review:
 - Rebase against the latest u-boot-usb master.
 - Replace typedef with #define.
 - Use the existing flags struct field instead of adding a new field.
 - Remove the setter function.
 - Remove the typecasts.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Cc: Jim Shimer <mgi2475@motorola.com>
common/usb_storage.c