From 9fb63c201a8cf97be5932c8d0e9636f367626d0c Mon Sep 17 00:00:00 2001 From: LiGang Date: Fri, 10 Aug 2012 19:21:47 +0800 Subject: ENGR00220076 fix the fastboot usb re-connect issue in fastboot mode, if usb cable re-connectted, the fastboot feature will fail. This issue is caused by logic control oversight. Signed-off-by: LiGang --- drivers/fastboot/fastboot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/fastboot/fastboot.c b/drivers/fastboot/fastboot.c index 75d2034..3dcab32 100644 --- a/drivers/fastboot/fastboot.c +++ b/drivers/fastboot/fastboot.c @@ -625,6 +625,10 @@ int fastboot_usb_recv(u8 *buf, int count) while (!len) { if (is_usb_disconnected()) { + /*it will not unconfigure when disconnect + from host, so here needs manual unconfigure + anyway, it's just a workaround*/ + fastboot_configured_flag = 0; usb_disconnected = 1; return 0; } @@ -654,6 +658,10 @@ int fastboot_poll() if (usb_disconnected) { udc_disconnect(); udc_connect(); + /*the udc_connect will be blocked until connect to host + so, the usb_disconnect should be 0 after udc_connect, + and should be set manually. Anyway, it's just a workaround*/ + usb_disconnected = 0; } if (!length) -- cgit v1.1