Commit c5a9ca3
yupei_lin
usb: dwc2: hcd: fix isoc out transfer with unaligned dma address
From rk3288_linux_release_v2.2.0_20200708
This DWC2 driver has handled the unaligned DMA address problem
for urb->transfer_buffer and split in transfer. But it still
has problem to handle the isoc out transfer with unaligned DMA
address.
I test an USB Audio device which supports 24bits 96KHz 3LE format:
usb 1-1: new full-speed USB device number 2 using dwc2
usb 1-1: New USB device found, idVendor=21b4, idProduct=0083, bcdDevice= 1.06
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: AudioQuest DragonFly Black v1.5
usb 1-1: Manufacturer: AudioQuest
usb 1-1: SerialNumber: AQDFBL0100023815
When play 24bits 96KHz WAV file, noise occurs.
The rootcause is that the DWC2 controller use internal DMA to
transfer USB audio data, and the DMA address of data buffer must
be 4 bytes aligned, otherwise, the dwc2 will fail to transfer the
data. In this test case, the USB audio may transfer 572 bytes or
582 bytes in one usb transaction. And one URB contains multiple
usb transactions, if the DWC2 transfer the 582 Bytes in the middle
of the URB, the DMA address will not be 4 bytes aligned.
This patch allocates new aligned buf for isoc out transfer with
unaligned DMA address.
For isoc split out transfer, this patch sets the start schedule at
the 2 * DWC2_SLICES_PER_UFRAME to transfer the SSPLIT-begin OUT
transaction like EHCI controller. Without this patch, the SSPLIT-begin
OUT transaction starts in the seventh microframe, and this makes the
USB HUB unhappy. This patch sets the the SSPLIT-begin OUT transaction
starts in the first microframe.
Change-Id: I4bca16b1ebdb23d0270e3e51befe32643cd4f2a01 parent 127c70a commit c5a9ca3
2 files changed
+30
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2549 | 2549 | | |
2550 | 2550 | | |
2551 | 2551 | | |
2552 | | - | |
2553 | | - | |
2554 | | - | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
2555 | 2556 | | |
| 2557 | + | |
| 2558 | + | |
2556 | 2559 | | |
2557 | 2560 | | |
2558 | 2561 | | |
| |||
2564 | 2567 | | |
2565 | 2568 | | |
2566 | 2569 | | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
2567 | 2582 | | |
2568 | 2583 | | |
2569 | 2584 | | |
| |||
2758 | 2773 | | |
2759 | 2774 | | |
2760 | 2775 | | |
2761 | | - | |
2762 | | - | |
| 2776 | + | |
| 2777 | + | |
2763 | 2778 | | |
2764 | | - | |
| 2779 | + | |
2765 | 2780 | | |
2766 | 2781 | | |
2767 | 2782 | | |
| |||
2775 | 2790 | | |
2776 | 2791 | | |
2777 | 2792 | | |
2778 | | - | |
2779 | | - | |
| 2793 | + | |
| 2794 | + | |
2780 | 2795 | | |
2781 | 2796 | | |
2782 | 2797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
731 | 734 | | |
732 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
733 | 739 | | |
734 | 740 | | |
735 | 741 | | |
| |||
0 commit comments