]> asedeno.scripts.mit.edu Git - linux.git/commit
usb: dwc2: fix isoc split in transfer with no data
authorWilliam Wu <william.wu@rock-chips.com>
Fri, 11 May 2018 09:46:32 +0000 (17:46 +0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 19 Jun 2018 09:48:13 +0000 (12:48 +0300)
commit70c3c8cb83856758025c2a211dd022bc0478922a
treea8d259714b7ce0b802cb59ed5b4f4494fc739376
parentaf424a410749ed7e0c2bffd3cedbc7c274d0ff6f
usb: dwc2: fix isoc split in transfer with no data

If isoc split in transfer with no data (the length of DATA0
packet is zero), we can't simply return immediately. Because
the DATA0 can be the first transaction or the second transaction
for the isoc split in transaction. If the DATA0 packet with no
data is in the first transaction, we can return immediately.
But if the DATA0 packet with no data is in the second transaction
of isoc split in transaction sequence, we need to increase the
qtd->isoc_frame_index and giveback urb to device driver if needed,
otherwise, the MDATA packet will be lost.

A typical test case is that connect the dwc2 controller with an
usb hs Hub (GL852G-12), and plug an usb fs audio device (Plantronics
headset) into the downstream port of Hub. Then use the usb mic
to record, we can find noise when playback.

In the case, the isoc split in transaction sequence like this:

- SSPLIT IN transaction
- CSPLIT IN transaction
  - MDATA packet (176 bytes)
- CSPLIT IN transaction
  - DATA0 packet (0 byte)

This patch use both the length of DATA0 and qtd->isoc_split_offset
to check if the DATA0 is in the second transaction.

Tested-by: Gevorg Sahakyan <sahakyan@synopsys.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Minas Harutyunyan hminas@synopsys.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/hcd_intr.c