PCIe在ISR内读写 [英] PCIe read write within ISR
问题描述
我在ARM上运行Linux并通过PCIe访问FPGA。我可以在驱动程序代码中执行对PCIe的读/写操作,但不能在ISR中执行。
我正在修改linux PCIe驱动程序以使用altera FPGA PCIe核心。在我的驱动程序代码中,我是pci_set_master(dev)使PCIe读写工作。
我正在使用altera SG-DMA进行PCIe传输而不是使用ARM DMA。我需要将启用位写入FPGA DMA以启动传输。它通过对启用位寄存器进行pcie写入(barx,偏移,数据)来完美地工作。
问题是,我需要我的系统来启动PCIe FPGA发生I / O中断时发生DMA,但是当发生中断时,在ISR中我把pcie写入(barx,offset,data),这导致整个linux挂起。
以前有人面对这个吗?请帮我。提前谢谢。
I'm running Linux on ARM and accessing FPGA through PCIe. I can perform read/write to PCIe in driver code but not in ISR.
I'm modifying a linux PCIe driver to work with altera FPGA PCIe core. Inside my driver code, I'do pci_set_master(dev) to make the PCIe read write working.
I'm using altera SG-DMA to do PCIe transfer instead of using ARM DMA. I need to write enable bit to the FPGA DMA to initiate the transfer. It is working perfectly by doing pcie write(barx,offset,data) to the enable bit register.
The problem is, I need my system to initiate the PCIe FPGA DMA when an I/O interrupt happen, but when interrupt happen, inside the ISR i put the pcie write(barx,offset,data) and this cause the whole linux hang there.
Anyone have face this before? Please help me. Thanks in advance.
推荐答案
对不起伙计们,我发现我做错了码。完成探测后,我不小心取消了驱动程序空间中的bar0地址。因此中断发生,它使写入bar0失败。我已经解决了这个问题。
谢谢
Hi,
Sorry guys, I found something I do wrong within my code. I accidentally unmap the bar0 address in driver space once it finish probing. Hence the the interrupt happened, it make write into bar0 failed. I solved this already.
Thanks
这篇关于PCIe在ISR内读写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!