There are a few issues in DWC3 driver when preparing for TRB. The driver needs to account the following: * MPS alignment for ZLP OUT direction * Extra TRBs when checking for available TRBs * SG entries size > request length Along with these fixes, there are some cleanup/refactoring patches in this series . Thinh Nguyen (7): usb: dwc3: gadget: Don't setup more than requested usb: dwc3: gadget: Fix handling ZLP usb: dwc3: gadget: Handle ZLP for sg requests usb: dwc3: gadget: Refactor preparing TRBs usb: dwc3: gadget: Account for extra TRB usb: dwc3: gadget: Rename misleading function names usb: dwc3: ep0: Skip ZLP setup for OUT drivers/usb/dwc3/ep0.c | 2 +- drivers/usb/dwc3/gadget.c | 232 ++++++++++++++++++++++---------------- 2 files changed, 137 insertions(+), 97 deletions(-) base-commit: e3ee0e740c3887d2293e8d54a8707218d70d86ca -- 2.28.0