Index: sys/external/bsd/dwc2/dist/dwc2_hcd.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/dwc2/dist/dwc2_hcd.c,v retrieving revision 1.13 diff -u -p -r1.13 dwc2_hcd.c --- sys/external/bsd/dwc2/dist/dwc2_hcd.c 3 Jul 2014 07:18:42 -0000 1.13 +++ sys/external/bsd/dwc2/dist/dwc2_hcd.c 3 Jul 2014 07:37:24 -0000 @@ -887,6 +887,22 @@ enum dwc2_transaction_type dwc2_hcd_sele if (list_empty(&hsotg->free_hc_list)) break; qh = list_entry(qh_ptr, struct dwc2_qh, qh_list_entry); + + /* + * Check to see if this is a NAK'd retransmit, in which case + * ignore for retransmission. We hold off on bulk + * retransmissions to reduce NAK interrupt overhead for + * cheeky devices that just hold off using NAKs. + */ + if (qh->nak_frame != 0xffff && + dwc2_full_frame_num(qh->nak_frame) == + dwc2_full_frame_num(dwc2_hcd_get_frame_number(hsotg))) { + qh_ptr = qh_ptr->next; + continue; + } else { + qh->nak_frame = 0xffff; + } + if (hsotg->core_params->uframe_sched > 0) { if (hsotg->available_host_channels < 1) break; Index: sys/external/bsd/dwc2/dist/dwc2_hcd.h =================================================================== RCS file: /cvsroot/src/sys/external/bsd/dwc2/dist/dwc2_hcd.h,v retrieving revision 1.8 diff -u -p -r1.8 dwc2_hcd.h --- sys/external/bsd/dwc2/dist/dwc2_hcd.h 3 Apr 2014 06:34:58 -0000 1.8 +++ sys/external/bsd/dwc2/dist/dwc2_hcd.h 3 Jul 2014 07:37:24 -0000 @@ -243,6 +243,7 @@ enum dwc2_transaction_type { * @interval: Interval between transfers in (micro)frames * @sched_frame: (Micro)frame to initialize a periodic transfer. * The transfer executes in the following (micro)frame. + * @nak_frame: Internal variable used by the NAK holdoff code * @frame_usecs: Internal variable used by the microframe scheduler * @start_split_frame: (Micro)frame at which last start split was initialized * @ntd: Actual number of transfer descriptors in a list @@ -277,6 +278,7 @@ struct dwc2_qh { u16 usecs; u16 interval; u16 sched_frame; + u16 nak_frame; u16 frame_usecs[8]; u16 start_split_frame; u16 ntd; Index: sys/external/bsd/dwc2/dist/dwc2_hcdintr.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c,v retrieving revision 1.8 diff -u -p -r1.8 dwc2_hcdintr.c --- sys/external/bsd/dwc2/dist/dwc2_hcdintr.c 3 Apr 2014 06:34:58 -0000 1.8 +++ sys/external/bsd/dwc2/dist/dwc2_hcdintr.c 3 Jul 2014 07:37:24 -0000 @@ -1211,6 +1211,17 @@ static void dwc2_hc_nak_intr(struct dwc2 chnum); /* + * When we get control/bulk NAKs then remember this so we holdoff on + * this qh until the beginning of the next frame + */ + switch (dwc2_hcd_get_pipe_type(&qtd->urb->pipe_info)) { + case USB_ENDPOINT_XFER_CONTROL: + case USB_ENDPOINT_XFER_BULK: + chan->qh->nak_frame = dwc2_hcd_get_frame_number(hsotg); + break; + } + + /* * Handle NAK for IN/OUT SSPLIT/CSPLIT transfers, bulk, control, and * interrupt. Re-start the SSPLIT transfer. */ Index: sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c,v retrieving revision 1.10 diff -u -p -r1.10 dwc2_hcdqueue.c --- sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c 3 Jul 2014 07:18:42 -0000 1.10 +++ sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c 3 Jul 2014 07:37:25 -0000 @@ -94,6 +94,7 @@ static void dwc2_qh_init(struct dwc2_hso dev_speed = dwc2_host_get_speed(hsotg, urb->priv); dwc2_host_hub_info(hsotg, urb->priv, &hub_addr, &hub_port); + qh->nak_frame = 0xffff; if ((dev_speed == USB_SPEED_LOW || dev_speed == USB_SPEED_FULL) && hub_addr != 0 && hub_addr != 1) {