mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
UPSTREAM: usb: dwc3: gadget: Handle 0 xfer length for OUT EP
For OUT endpoints, zero-length transfers require MaxPacketSize buffer as per the DWC_usb3 programming guide 3.30a section 4.2.3.3. This patch fixes this by explicitly checking zero length transfer to correctly pad up to MaxPacketSize. Change-Id: I9dff2dabdbe1c5cd86ef213356bcbefe90d0e1be Fixes:c6267a5163("usb: dwc3: gadget: align transfers to wMaxPacketSize") Cc: stable@vger.kernel.org Signed-off-by: Tejas Joglekar <joglekar@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: William Wu <william.wu@rock-chips.com> (cherry picked from commit1e19cdc806)
This commit is contained in:
committed by
Tao Huang
parent
1ece9bc9ac
commit
b0073d70ef
@@ -1111,7 +1111,7 @@ static void dwc3_prepare_one_trb_linear(struct dwc3_ep *dep,
|
||||
unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);
|
||||
unsigned int rem = length % maxp;
|
||||
|
||||
if (rem && usb_endpoint_dir_out(dep->endpoint.desc)) {
|
||||
if ((!length || rem) && usb_endpoint_dir_out(dep->endpoint.desc)) {
|
||||
struct dwc3 *dwc = dep->dwc;
|
||||
struct dwc3_trb *trb;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user