免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 8166 | 回复: 21
打印 上一主题 下一主题

[硬件及驱动] pci dev的interrupte line register的疑问。。。 [复制链接]

论坛徽章:
4
酉鸡
日期:2014-03-21 23:19:50狮子座
日期:2014-08-01 22:11:40酉鸡
日期:2015-01-10 21:31:442015年辞旧岁徽章
日期:2015-03-03 16:54:15
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-07-01 16:32 |只看该作者 |倒序浏览
pci_dev->irq和设备配置空间的interrupte line register到底是不是一样的,如果不一样,请指点啊,谢谢!

论坛徽章:
0
2 [报告]
发表于 2014-07-01 19:47 |只看该作者
在我印像中这个好像没什么用,多数都不一样。
现在不是都直接使用MSI中断了吗?

论坛徽章:
4
酉鸡
日期:2014-03-21 23:19:50狮子座
日期:2014-08-01 22:11:40酉鸡
日期:2015-01-10 21:31:442015年辞旧岁徽章
日期:2015-03-03 16:54:15
3 [报告]
发表于 2014-07-02 08:30 |只看该作者
回复 2# EZWORD


    哦,你是说interrupte line register基本没用了?

从我的pc这里看pcie msi的也是一样的啊
Interrupt: pin A routed to IRQ 42(lspci 看到的应该是寄存器内容吧)
42:         21      16496         19          4   PCI-MSI-edge      eth0


论坛徽章:
17
水瓶座
日期:2013-08-29 12:09:27白羊座
日期:2014-08-07 12:36:42丑牛
日期:2014-07-24 12:44:41寅虎
日期:2014-04-16 16:15:33寅虎
日期:2014-03-12 09:28:43摩羯座
日期:2014-03-06 13:22:04技术图书徽章
日期:2014-03-06 11:34:50天蝎座
日期:2014-01-09 11:31:44寅虎
日期:2013-12-27 17:01:44双子座
日期:2013-12-27 12:32:29双子座
日期:2013-12-25 09:03:33丑牛
日期:2013-12-24 16:18:44
4 [报告]
发表于 2014-07-02 09:41 |只看该作者
回复 1# chishanmingshen

pci spec 3.0:

Interrupt Line
The Interrupt Line register is an eight-bit register used to communicate interrupt line routing
information. The register is read/write and must be implemented by any device (or device
function) that uses an interrupt pin. POST software will write the routing information into
this register as it initializes and configures the system.

The value in this register tells which input of the system interrupt controller(s) the device's
interrupt pin is connected to. The device itself does not use this value, rather it is used by
device drivers and operating systems
. Device drivers and operating systems can use this
information to determine priority and vector information. Values in this register are system
architecture specific


http://wiki.osdev.org/PCI

Interrupt Line: Specifies which input of the system interrupt controllers the device's interrupt pin is connected to and is implemented by any device that makes use of an interrupt pin. For the x86 architecture this register corresponds to the PIC IRQ numbers 0-15 (and not I/O APIC IRQ numbers) and a value of 0xFF defines no connection.


pci interrupt routing的话 spec举例但是可能还是很难懂,你可以看看:

http://www.openwatcom.org/index.php/PCI_Interrupt_Routing

这个说的比较详细!

论坛徽章:
0
5 [报告]
发表于 2014-07-02 18:09 |只看该作者
如果你是用8259来管理的pci的中断,这个寄存器还有意义,如果是用I/O APIC中断控制器,这个寄存器基本没有意义。另外pdev->irq的得到是,对于X86设备,INTA-INTD通过LPC与IO APCI的PIN16-PIN19相连,具体的对应关系叫做中断路由表,如果BIOS支持ACPI规范那个厂商会将中断路由表存放在DSDT中。在linux中pdev-irq的值在enable pci device的时候确定。基本上就是查找当前pci device 中断路由表得到gsi,让在将gsi转换为irq 请参见acpi_register_gsi函数。

论坛徽章:
4
酉鸡
日期:2014-03-21 23:19:50狮子座
日期:2014-08-01 22:11:40酉鸡
日期:2015-01-10 21:31:442015年辞旧岁徽章
日期:2015-03-03 16:54:15
6 [报告]
发表于 2014-07-05 17:20 |只看该作者
本帖最后由 chishanmingshen 于 2014-07-06 16:39 编辑

回复 5# xs3c


    >如果BIOS支持ACPI规范那个厂商会将中断路由表存放在DSDT中。在linux中pdev-irq的值在enable pci device的时候确定。基本上就是查找当前pci device 中断路由表得到gsi,让在将gsi转换为irq 请参见acpi_register_gsi函数。
      
     我的理解,这个查找 应该是lpc(或者说pci桥?)硬件完成的,对么?
   
     另外,在msi时也会用中断路由表么?从lspci看,是用的,奇怪。

     请指点,谢谢!

论坛徽章:
4
酉鸡
日期:2014-03-21 23:19:50狮子座
日期:2014-08-01 22:11:40酉鸡
日期:2015-01-10 21:31:442015年辞旧岁徽章
日期:2015-03-03 16:54:15
7 [报告]
发表于 2014-07-05 17:48 |只看该作者
回复 4# asuka2001


谢谢   
http://www.openwatcom.org/index.php/PCI_Interrupt_Routing 打不开啊

论坛徽章:
4
酉鸡
日期:2014-03-21 23:19:50狮子座
日期:2014-08-01 22:11:40酉鸡
日期:2015-01-10 21:31:442015年辞旧岁徽章
日期:2015-03-03 16:54:15
8 [报告]
发表于 2014-07-06 07:50 |只看该作者
本帖最后由 chishanmingshen 于 2014-07-06 16:21 编辑

回复 5# xs3c



    请教下:msi+多个中断号的设备,中断时该设备怎么知道应该提交msi capability list里的哪一个?

    类比legacy时,一个网卡设备在“收到报文完毕”时应该触发intA还是intB,我觉得这个应该是设备内部设置的。
    但是msi时如何实现?因为msi时的中断号那时还不确定!

论坛徽章:
0
9 [报告]
发表于 2014-07-07 10:02 |只看该作者
回复 6# chishanmingshen
我的理解,这个查找 应该是lpc(或者说pci桥?)硬件完成的,对么?

软件,linux kernel启动的时候负责做这个

   
另外,在msi时也会用中断路由表么?从lspci看,是用的,奇怪。


没有


   

论坛徽章:
4
酉鸡
日期:2014-03-21 23:19:50狮子座
日期:2014-08-01 22:11:40酉鸡
日期:2015-01-10 21:31:442015年辞旧岁徽章
日期:2015-03-03 16:54:15
10 [报告]
发表于 2014-07-07 10:09 |只看该作者
回复 9# xs3c

42:         21      16496         19          4   PCI-MSI-edge      eth0
我也觉得msi不用中断路由表,可是你怎么看这个msi的网卡的lspci信息?
    Interrupt: pin A routed to IRQ 42

请指点,谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP