1. 27 Oct, 2017 38 commits
  2. 21 Oct, 2017 2 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.9.58 · 4d4a6a3f
      Greg Kroah-Hartman authored
      4d4a6a3f
    • Manu Gautam's avatar
      usb: dwc3: gadget: Correct ISOC DATA PIDs for short packets · 480fd4fb
      Manu Gautam authored
      commit 40d829fb upstream.
      
      The PIDs for Isochronous data transfers are incorrect
      for high bandwidth IN endpoints when the request length
      is less than EP wMaxPacketSize.
      
      As per spec correct PIDs for ISOC data transfers are:
      
      1) For request length <= maxpacket
      	- DATA0,
      
      2) For maxpacket < length <= (2 * maxpacket)
      	- DATA1, DATA0
      
      3) For (2 * maxpacket) <  length <= (3 * maxpacket)
      	- DATA2, DATA1, DATA0.
      
      But driver always sets PCM fields based on wMaxPacketSize
      due to which DATA2 happens even for small requests.
      
      Fix this by setting the PCM field of trb->size depending
      on request length rather than fixing it to the value
      depending on wMaxPacketSize.
      
      Ideally it shouldn't give any issues as dwc3 will send
      0-length packet for next IN token if host sends (even
      after receiving a short packet). Windows seems to ignore
      this but with MacOS frame loss observed when using f_uvc.
      Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      [b-liu@ti.com added following change for v4.9.]
      
      -	unsigned int maxp = usb_endpoint_maxp(ep->desc);
      +	unsigned int maxp;
      +	maxp = usb_endpoint_maxp(ep->desc) & 0x07ff;
      Signed-off-by: default avatarBin Liu <b-liu@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      480fd4fb