]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: ep0: Fix ZLP for OUT ep0 requests
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 24 Sep 2020 08:21:43 +0000 (01:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:49 +0000 (11:08 +0100)
commit7ba24610f39fb71f37ecb03b8981e6bc8231cafd
tree8bd2dde0c748e8dc3007f5bafdba1c63cb46fbf9
parent9b1f935ae4daefbc6ff8929526875d55b7a53121
usb: dwc3: ep0: Fix ZLP for OUT ep0 requests

commit 66706077dc89c66a4777a4c6298273816afb848c upstream.

The current ZLP handling for ep0 requests is only for control IN
requests. For OUT direction, DWC3 needs to check and setup for MPS
alignment.

Usually, control OUT requests can indicate its transfer size via the
wLength field of the control message. So usb_request->zero is usually
not needed for OUT direction. To handle ZLP OUT for control endpoint,
make sure the TRB is MPS size.

Cc: stable@vger.kernel.org
Fixes: c7fcdeb2627c ("usb: dwc3: ep0: simplify EP0 state machine")
Fixes: d6e5a549cc4d ("usb: dwc3: simplify ZLP handling")
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