]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: ep0: Fix delay status handling
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 22 Oct 2020 22:44:59 +0000 (15:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 11:39:09 +0000 (12:39 +0100)
commit6cf7734e0dd02045faf47c7dec6aeb709eae17d5
tree4fd29b13151ef4356ca37667b336a14d06c585cb
parentc0220dd58ee0eca20548dbd7eb6ec02a1f35c6e2
usb: dwc3: ep0: Fix delay status handling

commit fa27e2f6c5e674f3f1225f9ca7a7821faaf393bb upstream.

If we want to send a control status on our own time (through
delayed_status), make sure to handle a case where we may queue the
delayed status before the host requesting for it (when XferNotReady
is generated). Otherwise, the driver won't send anything because it's
not EP0_STATUS_PHASE yet. To resolve this, regardless whether
dwc->ep0state is EP0_STATUS_PHASE, make sure to clear the
dwc->delayed_status flag if dwc3_ep0_send_delayed_status() is called.
The control status can be sent when the host requests it later.

Cc: <stable@vger.kernel.org>
Fixes: d97c78a1908e ("usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/ep0.c