]> git.ipfire.org Git - people/arne_f/kernel.git/commit
usb: dwc3: gadget: Fix handling ZLP
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Fri, 7 Aug 2020 02:46:29 +0000 (19:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:48 +0000 (11:29 +0200)
commit8301e3aa1c8d34ddcb4011710352604aa6fa1a06
treead8e98c3344d640da7c6bcf59bdc02a314f92905
parentd884a90cec5ace7ca767788ca574e68f9af2998a
usb: dwc3: gadget: Fix handling ZLP

commit d2ee3ff79e6a3d4105e684021017d100524dc560 upstream.

The usb_request->zero doesn't apply for isoc. Also, if we prepare a
0-length (ZLP) TRB for the OUT direction, we need to prepare an extra
TRB to pad up to the MPS alignment. Use the same bounce buffer for the
ZLP TRB and the extra pad TRB.

Cc: <stable@vger.kernel.org> # v4.5+
Fixes: d6e5a549cc4d ("usb: dwc3: simplify ZLP handling")
Fixes: 04c03d10e507 ("usb: dwc3: gadget: handle request->zero")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c