Fixed bugs in pl080
cover Fixed bugs in pl080
From: TaoDing <[email protected]>
Hi all,
I added pl080 to arm/virt, but when I tested it with the Linux dmatest, the test results did not meet expectations.
I found the following issues with pl080 in qemu:
1. pl080 did not generate an interrupt after data transfer, causing dmatest to timeout.
2. When swidth and dwidth are inconsistent, dmatest data verification failed.
3. When bit0 of the DMACC0LLI register is not 0, the guest crashes.
The proposed solutions for the above issues are as follows:
1. The interrupt should be updated after pl080_run completes.
2. The amount of data moved by pl080 each time should be determined based on the remaining data, swidth, and dwidth.
3. Force next_lli to be word-aligned.
Modified test results:
~ # modprobe dmatest channel=dma0chan0 iterations=10 run=1
[ 28.637273] dmatest: Added 1 threads using dma0chan0 [ 28.649934] dmatest: Started 1 threads using dma0chan0 [ 28.664846] pl08xdmac 9001000.pl080: src=0x43bac1d2+/4 dst=0x43bb00e6+/4 len=15863 [ 28.667140] pl08xdmac 9001000.pl080: mbus=dst sbus=src [ 28.668419] pl08xdmac 9001000.pl080: pl08x_fill_llis_for_desc byte width LLIs (remain 0x00003df7) [ 28.670659] pl08xdmac 9001000.pl080: pl08x_fill_llis_for_desc max bytes per lli = 16380 [ 28.672871] pl08xdmac 9001000.pl080: pl08x_fill_llis_for_desc fill lli with single lli chunk of size 0x00003df4 (remainder 0x00003df5) [ 28.676198] pl08xdmac 9001000.pl080: pl08x_fill_llis_for_desc align with boundary, send odd bytes (remain 1) [ 28.679140] pl08xdmac 9001000.pl080: lli csrc cdst clli cctl [ 28.681999] pl08xdmac 9001000.pl080: 0 @000000003a57aa5b: 0x43bac1d2 0x43bb00e6 0x4337e011 0x1e03f002 [ 28.685286] pl08xdmac 9001000.pl080: 1 @0000000080658250: 0x43bac1d4 0x43bb00e8 0x4337e021 0x1e4bff7d [ 28.687560] pl08xdmac 9001000.pl080: 2 @00000000ce9a3773: 0x43baffc8 0x43bb3edc 0x00000000 0x9e03f001 [ 28.691012] pl08xdmac 9001000.pl080: allocated physical channel 0 for xfer on memcpy0 [ 28.693065] pl08xdmac 9001000.pl080: WRITE channel 0: csrc=0x43bac1d2, cdst=0x43bb00e6, clli=0x4337e011, cctl=0x1e03f002, ccfg=0x0000c000 ... [ 28.941126] pl08xdmac 9001000.pl080: src=0x43bad504+/4 dst=0x43bb1848+/4 len=9233 [ 28.943821] pl08xdmac 9001000.pl080: mbus=dst sbus=src [ 28.944726] pl08xdmac 9001000.pl080: pl08x_fill_llis_for_desc max bytes per lli = 16380 [ 28.945643] pl08xdmac 9001000.pl080: pl08x_fill_llis_for_desc fill lli with single lli chunk of size 0x00002410 (remainder 0x00002411) [ 28.947219] pl08xdmac 9001000.pl080: pl08x_fill_llis_for_desc align with boundary, send odd bytes (remain 1) [ 28.948248] pl08xdmac 9001000.pl080: lli csrc cdst clli cctl [ 28.949171] pl08xdmac 9001000.pl080: 0 @000000003a57aa5b: 0x43bad504 0x43bb1848 0x4337e011 0x1e4bf904 [ 28.950958] pl08xdmac 9001000.pl080: 1 @0000000080658250: 0x43baf914 0x43bb3c58 0x00000000 0x9e03f001 [ 28.952028] pl08xdmac 9001000.pl080: allocated physical channel 0 for xfer on memcpy0 [ 28.953107] pl08xdmac 9001000.pl080: WRITE channel 0: csrc=0x43bad504, cdst=0x43bb1848, clli=0x4337e011, cctl=0x1e4bf904, ccfg=0x0000c000 [ 28.955467] pl08xdmac 9001000.pl080: txd 000000002cf18c89[b]: marked complete [ 28.960501] dmatest: dma0chan0-copy0: summary 10 tests, 0 failures 33.59 iops 359 KB/s (0)
TaoDing (1):
Fix the bug where the PL080 transfer complete interrupt is not
generated. Fix the bug where the PL080 LLI is not 32-bit aligned. Fix the bug when PL080's source and destination widths (swidth/dwidth) are inconsistent.
hw/dma/pl080.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-)
Signature · 1 line
2.43.0