From 7eb692a7ae44aa5dd34cf17d6c99c46d8885c2f1 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 75d2034ac3..3dcab329eb 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.2.3