From: Wu Liang feng Date: Tue, 6 Sep 2016 03:35:57 +0000 (+0800) Subject: Revert "UPSTREAM: usb: dwc3: gadget: disable XFER_NOT_READY" X-Git-Tag: firefly_0821_release~1587 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9438d4e7707522607420aea10b53a4ee153407e2;p=firefly-linux-kernel-4.4.55.git Revert "UPSTREAM: usb: dwc3: gadget: disable XFER_NOT_READY" This reverts commit 2a1f2d1e890354821dd8a8e621998d532185061d. Refer to DWC3 databook, Table 7-7 Device Endpoint-n Events(DEPEVT), XferNotReady is generated when the core responds NRDY to the host on the USB. It is useful in the beginning of a transfer when software wants to wait for the host to start polling the endpoint before setting up TRBs. And also refer to 8.2.4 Transfer Setup Recommendations, when using on-demand transfers, the XferNotRead event must be enabled. TEST=Set usb gadget work as RNDIS, connect to win7/win10, check the RNDIS function Change-Id: I091cd3ff4a3c93e6cc02fcc6714511c8989786bf Signed-off-by: Wu Liang feng --- diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 4842f934e9d5..776de55028f6 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -490,10 +490,8 @@ static int dwc3_gadget_set_ep_config(struct dwc3 *dwc, struct dwc3_ep *dep, params.param0 |= DWC3_DEPCFG_ACTION_INIT; } - params.param1 = DWC3_DEPCFG_XFER_COMPLETE_EN; - - if (dep->number <= 1 || usb_endpoint_xfer_isoc(desc)) - params.param1 |= DWC3_DEPCFG_XFER_NOT_READY_EN; + params.param1 = DWC3_DEPCFG_XFER_COMPLETE_EN + | DWC3_DEPCFG_XFER_NOT_READY_EN; if (usb_ss_max_streams(comp_desc) && usb_endpoint_xfer_bulk(desc)) { params.param1 |= DWC3_DEPCFG_STREAM_CAPABLE