summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2016-10-05 14:26:23 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-03 10:38:32 +0200
commitc9508c8c50f9ec6fc3e7e823f35c76fafba7e929 (patch)
treeb0c7607369d5122eff1ccd638e19bb5cbbcb7b20 /drivers/usb/dwc3/gadget.c
parent58f29034b4c47b202f76de055f843316c8a9325f (diff)
usb: dwc3: gadget: only interrupt on short if short_not_ok is set
We don't need to know about short packets unless gadget driver told us it's not ok to see them on the bus. In the normal situation we can continue processing the list of requests if we get a Short packet. Also, note that we're making sure ISP is only set for OUT endpoints, where that setting is valid. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 270e837f16e0..71d01b29e7b5 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -875,12 +875,16 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
}
/* always enable Continue on Short Packet */
- if (usb_endpoint_dir_out(dep->endpoint.desc))
+ if (usb_endpoint_dir_out(dep->endpoint.desc)) {
trb->ctrl |= DWC3_TRB_CTRL_CSP;
+ if (req->request.short_not_ok)
+ trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;
+ }
+
if ((!req->request.no_interrupt && !chain) ||
(dwc3_calc_trbs_left(dep) == 0))
- trb->ctrl |= DWC3_TRB_CTRL_IOC | DWC3_TRB_CTRL_ISP_IMI;
+ trb->ctrl |= DWC3_TRB_CTRL_IOC;
if (chain)
trb->ctrl |= DWC3_TRB_CTRL_CHN;