在英特尔 PCI 桥上启用 MSI

在英特尔 PCI 桥上启用 MSI

我使用的是 HP Z400 工作站,Linux 内核为 4.9.20。我尝试启用 MSI 中断,但 PCI 桥似乎禁用了 MSI 支持。

通过使用,lscpi -v我可以看到类似这样的内容,这Capabilities: [60] MSI: Enable- Count=1/2 Maskable+ 64bit-意味着 MSI 支持被禁用。

这意味着当我尝试通过执行类似操作在我的驱动程序中请求超过 1 个中断向量时,ret = pci_alloc_irq_vectors(pci_dev, 2, max_irqs, PCI_IRQ_ALL_TYPES | PCI_IRQ_AFFINITY);该函数会返回错误。

我已经在不同的电脑上测试了同样的方法并且效果很好,通过使用 lspci 我可以看到不同的输出:Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-

我还将 BIOS 升级到 HP 提供的最新版本,但没有注意到任何不同。

有谁知道这可能是什么原因造成的?

编辑:

以下是lspci -vvv同一台 PC(HP Z400)中两个不同桥接器的输出

00:01.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 (rev 13) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
I/O behind bridge: 0000f000-00000fff
Memory behind bridge: fff00000-000fffff
Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
BridgeCtl: Parity- SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-
    PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [40] Subsystem: Hewlett-Packard Company 5520/5500/X58 I/O Hub PCI Express Root Port 1
Capabilities: [60] MSI: Enable- Count=1/2 Maskable+ 64bit-
    Address: 00000000  Data: 0000
    Masking: 00000000  Pending: 00000000
Capabilities: [90] Express (v2) Root Port (Slot+), MSI 00
    DevCap: MaxPayload 256 bytes, PhantFunc 0
        ExtTag+ RBE+
    DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+ Unsupported-
        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
        MaxPayload 128 bytes, MaxReadReq 128 bytes
    DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
    LnkCap: Port #0, Speed 5GT/s, Width x4, ASPM L0s L1, Exit Latency L0s <512ns, L1 <64us
        ClockPM- Surprise+ LLActRep+ BwNot+ ASPMOptComp-
    LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
    LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
    SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise-
        Slot #0, PowerLimit 0.000W; Interlock- NoCompl-
    SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-
        Control: AttnInd Off, PwrInd Off, Power- Interlock-
    SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet- Interlock-
        Changed: MRL- PresDet- LinkState-
    RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible+
    RootCap: CRSVisible+
    RootSta: PME ReqID 0000, PMEStatus- PMEPending-
    DevCap2: Completion Timeout: Range BCD, TimeoutDis+, LTR-, OBFF Not Supported ARIFwd+
    DevCtl2: Completion Timeout: 260ms to 900ms, TimeoutDis-, LTR-, OBFF Disabled ARIFwd-
    LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
         Compliance De-emphasis: -6dB
    LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
         EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [e0] Power Management version 3
    Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
    Status: D3 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
Capabilities: [100 v1] Advanced Error Reporting
    UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
    UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
    UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
    CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
    CEMsk:  RxErr+ BadTLP+ BadDLLP+ Rollover+ Timeout+ NonFatalErr+
    AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
Capabilities: [150 v1] Access Control Services
    ACSCap: SrcValid+ TransBlk+ ReqRedir+ CmpltRedir+ UpstreamFwd+ EgressCtrl- DirectTrans-
    ACSCtl: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans-
Capabilities: [160 v0] Vendor Specific Information: ID=0002 Rev=0 Len=00c <?>
Kernel driver in use: pcieport
Kernel modules: shpchp



00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 6 (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin B routed to IRQ 25
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00002000-00002fff
Memory behind bridge: f8000000-f80fffff
Prefetchable memory behind bridge: 00000000f7500000-00000000f76fffff
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
BridgeCtl: Parity- SERR+ NoISA- VGA- MAbort- >Reset- FastB2B-
    PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00
    DevCap: MaxPayload 128 bytes, PhantFunc 0
        ExtTag- RBE+
    DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
        MaxPayload 128 bytes, MaxReadReq 128 bytes
    DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
    LnkCap: Port #6, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <256ns, L1 <4us
        ClockPM- Surprise- LLActRep+ BwNot- ASPMOptComp-
    LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
    LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive+ BWMgmt- ABWMgmt-
    SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+
        Slot #0, PowerLimit 0.000W; Interlock- NoCompl-
    SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-
        Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
    SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
        Changed: MRL- PresDet+ LinkState+
    RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
    RootCap: CRSVisible-
    RootSta: PME ReqID 0000, PMEStatus- PMEPending-
Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
    Address: fee00000  Data: 40e1
Capabilities: [90] Subsystem: Hewlett-Packard Company 82801JI (ICH10 Family) PCI Express Root Port 6
Capabilities: [a0] Power Management version 2
    Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
    Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [100 v1] Virtual Channel
    Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
    Arb:    Fixed+ WRR32- WRR64- WRR128-
    Ctrl:   ArbSelect=Fixed
    Status: InProgress-
    VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
        Arb:    Fixed+ WRR32- WRR64- WRR128- TWRR128- WRR256-
        Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=01
        Status: NegoPending- InProgress-
Capabilities: [180 v1] Root Complex Link
    Desc:   PortNumber=06 ComponentID=02 EltType=Config
    Link0:  Desc:   TargetPort=00 TargetComponent=02 AssocRCRB- LinkType=MemMapped LinkValid+
        Addr:   00000000fed1c000
Kernel driver in use: pcieport
Kernel modules: shpchp

查看lspci输出,我可以看到两者都使用相同的驱动程序,但一个启用了 MSI,而另一个没有。

答:经过一番挖掘,我发现一些英特尔芯片组 5500、5520 和 X58 存在 MSI 和中断重映射问题,因此 BIOS 供应商在固件中禁用了它。5500/5520 勘误表 Novell 知识库

答案1

经过一番挖掘,我发现一些英特尔芯片组 5500、5520 和 X58 存在 MSI 和中断重映射问题,因此 BIOS 供应商在固件中禁用了它。5500/5520 勘误表 Novell 知识库

相关内容