Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a6327c5e authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: f_mass_storage: Perform async runtime suspend after ep disable



commit 82f29356165b6a584 ("usb: gadget: f_mass_storage: Allow USB LPM
upon ep disable") decrements power usage count by 1 for dwc3 device
in thread handler as part of do_set_interface(). fsg_disable() and
fsg_unbind() will raise exception for status change so that status change
is handled in thread handler. Due to this, there is a chance that
fsg_thread can run two times and results in calling do_set_interface()
twice for disabling endpoints. This causes decrementing power usage count
two times instead of 1 and power usage count can become negative. If cable
is disconnected at this time, it could cause unclocked access or fsg_thread
gets stuck. common->fsg bieng non NULL confirms that MSC interface is being
enabled. Hence fix the issue by decrementing power usage count only right
after disbling endpoints as disabling endpoints happens once due to check
of common->fsg.

Change-Id: Ia870838f5a7055436b7412fec5910b5cdbb42de2
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent cc843309
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment