When connection is established non-ss mode, a maxburst is set to 0.
Therefore, the value of burst size has wrong value. We must use the burst size
only in superspeed mode.

Signed-off-by: Chanho Park <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
---
 drivers/usb/dwc3/gadget.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 58fdfad..6516560 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -438,8 +438,14 @@ static int dwc3_gadget_set_ep_config(struct dwc3 *dwc, 
struct dwc3_ep *dep,
        memset(&params, 0x00, sizeof(params));
 
        params.param0 = DWC3_DEPCFG_EP_TYPE(usb_endpoint_type(desc))
-               | DWC3_DEPCFG_MAX_PACKET_SIZE(usb_endpoint_maxp(desc))
-               | DWC3_DEPCFG_BURST_SIZE(dep->endpoint.maxburst - 1);
+               | DWC3_DEPCFG_MAX_PACKET_SIZE(usb_endpoint_maxp(desc));
+
+       /* Burst size is only needed in SuperSpeed mode */
+       if (dwc->gadget.speed == USB_SPEED_SUPER) {
+               u32 burst = dep->endpoint.maxburst - 1;
+
+               params.param0 |= DWC3_DEPCFG_BURST_SIZE(burst);
+       }
 
        params.param1 = DWC3_DEPCFG_XFER_COMPLETE_EN
                | DWC3_DEPCFG_XFER_NOT_READY_EN;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to