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

Skip to content
Commit 46b07177 authored by Jack Pham's avatar Jack Pham Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: gadget: Ensure no control transfers in progress when stopping



When dwc3_gadget_pullup() is called to perform a device-initiated
disconnect, the driver must ensure that no transfers are in progress
before clearing the run/stop bit. Currently there is a check which
ensures ep0 is in EP0_SETUP_PHASE and if not simply waits for any
pending control transfer to conclude and return to that initial state.
However, since this is done before the dwc->lock is acquired, this
allows for a race in which a new ep0 transfer gets started and we
receive another SETUP packet from the host before proceeding to take
the lock.

To fix this, simply don't allow a new ep0 transfer to start if
dwc->softconnect is false.

Change-Id: Ie79c99bfa2b305ef44695d01b3f9395253aaf8f8
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 62ea0b2a
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