summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorTony LIU <junjie.liu@freescale.com>2012-07-20 09:51:17 +0800
committerTerry Lv <r65388@freescale.com>2012-07-25 13:11:29 +0800
commit2121d647a84064e9a7fb74b65a6921331664b222 (patch)
tree97ee0c410ecc165ab1e55ed18b46279c260d9388 /drivers/usb
parent7788e54ceeaa638990b8ccb67cc5c5bd37a275d6 (diff)
ENGR00217719 usb gadget msc may enumeration fail if msc storage response slow
- communication between the usb driver and msc class driver is using raise_exception/handle_excpetion, such mechaism can only have two events(exceptions) at most, one is on processing and another is store to be executed after the current one completed. If the first one processing is very slow, and the third one occur, then the second one will be overwriten by the third one and then the second event is lost and then enumeration failed - since it is the linux community code, it is hard to change the whole frame work, currently only a work around is provided - because this issue is brought in when the first reset event, when this event occur, a lun sync will happen and it will cost much time, but in fact this lun sync is not necessary for the first reset event, the work around is to skip this lun sync. Signed-off-by: Tony LIU <junjie.liu@freescale.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/file_storage.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 9b4f105f106a..36b8c2b70150 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3049,8 +3049,9 @@ static void handle_exception(struct fsg_dev *fsg)
break;
case FSG_STATE_DISCONNECT:
- for (i = 0; i < fsg->nluns; ++i)
- fsg_lun_fsync_sub(fsg->luns + i);
+ if (fsg->config != 0)
+ for (i = 0; i < fsg->nluns; ++i)
+ fsg_lun_fsync_sub(fsg->luns + i);
do_set_config(fsg, 0); // Unconfigured state
break;