OSDN Git Service

usb: gadget: f_mass_storage: Allow USB LPM upon ep disable
authorHemant Kumar <hemantk@codeaurora.org>
Sat, 18 Feb 2017 01:00:38 +0000 (17:00 -0800)
committerHemant Kumar <hemantk@codeaurora.org>
Sat, 25 Feb 2017 01:46:39 +0000 (17:46 -0800)
commit82f29356165b6a584441fb3c442efed19784ce83
treec6317e784aab145071fe8d76ac537409e09f05d4
parentf44d9e364a517b521ea9081af73e85e78289c0dd
usb: gadget: f_mass_storage: Allow USB LPM upon ep disable

Upon cable disconnect, there is a possibility of USB LPM
before file-storage thread run to completion. This causes
ep dequeue to fail and results into thread to block for
ever. Prevent this situation by incrementing power usage
count on gadget parent upon ep enable and decrement it
upon ep disable and allow USB LPM after that.

Change-Id: Ic3633320de6ebef912bdaeac305b3dd0df3eb8e0
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
drivers/usb/gadget/function/f_mass_storage.c