Arria 10 - Avalon MM DMA for PCIe crashes the PC when re-initializing the descriptor controller
Hi!
I'm using the Avalon MM DMA for PCIe on a Terasic TR10a-HL Arria 10 board.
The card is running the provided PCIe_Fundamental.sof demo image and is plugged into a server PC.
I'm currently writing a VFIO based linux userspace driver for the card.
As outlined in ug_a10_pcie_avmm_dma-683425-666332.pdf, my program allocates DMA memory, and initializes the Read and Write DMA descriptor controller registers via BAR0.
On the first program run, everything works fine: I can issue read and write DMA requests.
Problem: If I start the program a 2nd time and re-initialize the descriptor controller with different descriptor table addresses, the PC reboots.
Seemingly, the FPGA issues some random DMA requests that crash the PC.
Workaround: Reconfigure the FPGA before each program run. This will reset the descriptor controller to its reset state (RD_DMA_LAST_PTR = 0xFF, WR_TABLE_SIZE = 0x7F, everything else 0).
Questions:
1. What is the correct sequence to re-init the descriptor controller?
The ug_a10_pcie_avmm_dma manual says on page 82:
RC Read Status and Descriptor Base (Low)
[..] To change the RC Read Status and
Descriptor Base (Low)base address, all
descriptors specified by the RD_TABLE_SIZE
must be exhausted.
What does "exhausted" mean in this context?
2. Is there a way to reset the DMA engine without reconfiguring the FPGA?
Hi,
The pin_perst is the power on reset of the FPGA board, when you reboot the host, it will toggle the pin_perst. Where the npor is driven by soft reset (user application), but the soft reset will also bring down the link, once link being bring down, we need to rebooting the PC.
I have a discussion with another PCIe specialty, it seem like there is no other alternative to reset the DMA controller alone beside reboot the PC.
Hope this answered your question.
Regards,
Wincent_Intel