dwc_otg: make nak_holdoff work as intended with empty queues
authorP33M <p33m@github.com>
Thu, 27 Apr 2017 15:24:34 +0000 (16:24 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 8 Oct 2017 01:07:29 +0000 (01:07 +0000)
commit1c8fd7e493340259f71c651484e0eefe7437044e
tree51f6024649c630d62df3d8b0d9b5696bf1b2ecde
parentde8fc98ea2924e33836dd30e3653d36fff13f5df
dwc_otg: make nak_holdoff work as intended with empty queues

If URBs reading from non-periodic split endpoints were dequeued and
the last transfer from the endpoint was a NAK handshake, the resulting
qh->nak_frame value was stale which would result in unnecessarily long
polling intervals for the first subsequent transfer with a fresh URB.

Fixup qh->nak_frame in dwc_otg_hcd_urb_dequeue and also guard against
a case where a single URB is submitted to the endpoint, a NAK was
received on the transfer immediately prior to receiving data and the
device subsequently resubmits another URB past the qh->nak_frame interval.

Fixes https://github.com/raspberrypi/linux/issues/1709
drivers/usb/host/dwc_otg/dwc_otg_hcd.c
drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c