简体   繁体   English

从Linux内核空间到PCIe卡的DMA

[英]DMA from Linux kernel-space to PCIe card

I am trying to write a linux driver for a PCIe device - the Adlink PCIe 7300A High-Speed digital-IO card. 我正在尝试为PCIe设备编写一个Linux驱动程序--Adlink PCIe 7300A高速数字IO卡。

The driver works fine for normal memory transfer, but attempting to use the card's bus-mastering capabilities to initiate DMA transfer of a buffer from CPU memory to the device's output FIFO buffer simply does not work. 驱动程序适用于正常的内存传输,但尝试使用卡的总线主控功能来启动缓冲区从CPU内存到设备输出FIFO缓冲区的DMA传输根本不起作用。

I have been trying to solve this problem on the order of weeks, not on the order of days. 我一直试图在几周的时间内解决这个问题,而不是几天。

Any insight at all would really really be appreciated. 任何见解都真的非常值得赞赏。

Driver code -- https://github.com/sbrookes/timing_driver_sdarn/blob/master/kernel_land/timing.c 驱动程序代码 - https://github.com/sbrookes/timing_driver_sdarn/blob/master/kernel_land/timing.c

Device Datasheet -- http://www.acceed.com/manuals/adlink/P7300A%20Manual.PDF 设备数据表 - http://www.acceed.com/manuals/adlink/P7300A%20Manual.PDF

PLX 9080 PCI Interface chip Datasheet -- http://www.der-ingo.de/bin/milanhelp/PLX9080.pdf PLX 9080 PCI接口芯片数据表 - http://www.der-ingo.de/bin/milanhelp/PLX9080.pdf

I can not explain how much I would appreciate any bit of insight. 我无法解释我多么欣赏任何洞察力。

Thank you, 谢谢,

Scott 斯科特

I seem to have solved the problem. 我好像已经解决了这个问题。 It seems like there was an incorrect condition in the interrupt handler that was aborting the DMA transfer at the wrong time, never letting the transfer even begin. 看起来中断处理程序中的错误条件是在错误的时间中止DMA传输,从不让转移开始。

A serious "duh" moment, but it took serious struggle to find it. 一个严肃的“呃”时刻,但找到它需要认真的努力。

As per the comments, sorry if I polluted SO with my desperation. 根据评论,抱歉,如果我绝望地污染了SO。 Still learning how to be a good citizen. 还在学习如何成为一个好公民。

Not sure if the code linked above will remain static as my project changes or whether that link will reflect the most current version. 不确定上面链接的代码是否会在我的项目更改时保持静态,或者该链接是否会反映最新版本。 Basically just be careful not to abort your transfer at the wrong time. 基本上要小心,不要在错误的时间中止您的转移。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM