- 论坛徽章:
- 0
|
回复 4# guoissac
感谢folklore先生的指点,我又仔细折腾了一遍我的驱动代码,发现对PCI基地址和PCI 的Register的操作代码还是有问题;
后来又搜到一篇文章,是翻译 /Documentation/PCI/pci.txt的;但是译的不好,于是又仔细读了原文,发现这么一段:
3.2 Request MMIO/IOP resources
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Memory (MMIO), and I/O port addresses should NOT be read directly from the PCI device config space.
Use the values in the pci_dev structure as the PCI "bus address" might have been remapped to a "host physical" address by the arch/chip-set specific kernel support.
然后看了我自己的代码,发现没有按照上面这段话说的那样"Use the values in the pci_dev structure" , 我把pci_resource_start()获得的BAR 赋值给了另外一个变量,后面对Register的操作都是通过这个变量来进行,导致死机。
改为 “Use the values in the pci_dev structure”,问题解决;
现在中断程序跑得哗哗的。
感谢folklore先生的指点,感谢各位。
|
|