diff options
author | Jiebing Li <jiebing.li@intel.com> | 2012-08-07 14:29:21 +0800 |
---|---|---|
committer | Bo Huang <bo.b.huang@intel.com> | 2014-04-25 14:15:08 +0800 |
commit | bbb7981e49048a657d724bfda9465cdfe7c03a87 (patch) | |
tree | 72aefdf303a719a57130fb98b775c7ad72a5150c /fastboot | |
parent | 72031ab8780ddbdfad84ea4a02ba7fe87566ee50 (diff) | |
download | system_core-bbb7981e49048a657d724bfda9465cdfe7c03a87.zip system_core-bbb7981e49048a657d724bfda9465cdfe7c03a87.tar.gz system_core-bbb7981e49048a657d724bfda9465cdfe7c03a87.tar.bz2 |
Fastboot: fix fastboot timeout issue of Windows host side
Normally fastboot follows the procedure that host sends a command
to device and device sends back response after the command
is executed.
But sometimes device spends too long time to execute the command
so that timeout error occurs before host receives the response.
This patch fixes the issue by aligning with the solution of ADB.
ADB commit id: 1c4b760a5d41de3196572d50d1404e453174cf9a
Change-Id: I50e6bf428ea38219b64cca6ab82db22af28e0264
Author: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Diffstat (limited to 'fastboot')
-rw-r--r-- | fastboot/usb_windows.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fastboot/usb_windows.c b/fastboot/usb_windows.c index 07f7be2..f666015 100644 --- a/fastboot/usb_windows.c +++ b/fastboot/usb_windows.c @@ -152,7 +152,7 @@ usb_handle* do_usb_open(const wchar_t* interface_name) { } int usb_write(usb_handle* handle, const void* data, int len) { - unsigned long time_out = 500 + len * 8; + unsigned long time_out = 5000; unsigned long written = 0; unsigned count = 0; int ret; @@ -194,7 +194,7 @@ int usb_write(usb_handle* handle, const void* data, int len) { } int usb_read(usb_handle *handle, void* data, int len) { - unsigned long time_out = 500 + len * 8; + unsigned long time_out = 0; unsigned long read = 0; int ret; @@ -212,7 +212,7 @@ int usb_read(usb_handle *handle, void* data, int len) { DBG("usb_read got: %ld, expected: %d, errno: %d\n", read, xfer, errno); if (ret) { return read; - } else if (errno != ERROR_SEM_TIMEOUT) { + } else { // assume ERROR_INVALID_HANDLE indicates we are disconnected if (errno == ERROR_INVALID_HANDLE) usb_kick(handle); |