如何在从 uefi/acpi 启动的正在运行的 Linux 系统中查找 pcie 控制器的内核驱动程序名称?

如何在从 uefi/acpi 启动的正在运行的 Linux 系统中查找 pcie 控制器的内核驱动程序名称?

我有一台运行 Ubuntu 20.04 的 Ampere ARMv8 服务器。我想找出用于 PCIe 控制器的内核驱动程序。我该怎么做?

我的目的是证明假设对于安装官方发行版(例如未经修改的 Ubuntu/Debian)的服务器(具有 UEFI/ACPI 功能),PCIe 控制器驱动程序必须位于该发行版的内核源代码树中。

我的 Ampere 服务器的部分dmesg|grep -i pci输出如下:

root@ampere:/sys/bus/platform/drivers# dmesg|grep -i pci
[    0.108502] PCI/MSI: ITS@0x100100080000 domain created
[    0.108504] PCI/MSI: ITS@0x1001000a0000 domain created
[    0.108506] PCI/MSI: ITS@0x1001000c0000 domain created
[    0.108508] PCI/MSI: ITS@0x1001000e0000 domain created
[    0.108509] PCI/MSI: ITS@0x100100100000 domain created
[    0.108511] PCI/MSI: ITS@0x100100120000 domain created
[    0.108512] PCI/MSI: ITS@0x500100080000 domain created
[    0.108514] PCI/MSI: ITS@0x5001000a0000 domain created
[    0.108516] PCI/MSI: ITS@0x5001000c0000 domain created
[    0.108517] PCI/MSI: ITS@0x5001000e0000 domain created
[    0.108519] PCI/MSI: ITS@0x500100100000 domain created
[    0.108520] PCI/MSI: ITS@0x500100120000 domain created
[    0.429505] ACPI: bus type PCI registered
[    0.429507] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    9.670274] ACPI: PCI Root Bridge [PCI2] (domain 0000 [bus 00-ff])
[    9.685558] acpi PNP0A08:02: _OSC: platform does not support [PCIeHotplug SHPCHotplug PME LTR]
[    9.694213] acpi PNP0A08:02: _OSC: OS now controls [AER PCIeCapability]
[    9.700821] acpi PNP0A08:02: MCFG quirk: ECAM at [mem 0x3bfff0000000-0x3bffffffffff] for [bus 00-ff] with pci_32b_read_ops
[    9.729932] PCI host bridge to bus 0000:00
[    9.734016] pci_bus 0000:00: root bus resource [mem 0x30000000-0x37ffffff window]
[    9.741486] pci_bus 0000:00: root bus resource [mem 0x380000000000-0x3bffdfffffff window]
[    9.749649] pci_bus 0000:00: root bus resource [bus 00-ff]
[    9.755139] pci 0000:00:00.0: [1def:e100] type 00 class 0x060000
[    9.761191] pci 0000:00:01.0: [1def:e101] type 01 class 0x060400
...

我从以下来源获得信息/sys

root@ampere:/sys/bus/platform/drivers# find . -type d|grep -i pci
./pci-host-generic
./advk-pcie
./pci_thunder_pem
./armada8k-pcie
./dw-pcie
./xilinx-pcie
./altera-pcie
./imx6q-pcie
./hisi-pcie-almost-ecam
./cdns-pcie-ep
./qcom-pcie
./rcar-pcie
./kirin-pcie
./ftpci100
./keystone-pcie
./cdns-pcie-host
./pci_thunder_ecam
./nwl-pcie
./mobiveil-pcie
./xgene-pcie
./rockchip-pcie-ep
./histb-pcie
./hisi-pcie
./al-pcie
./mtk-pcie

并且lspci -k主桥也没有显示内核驱动程序信息:

...
 \-[0000:00]-+-00.0  Ampere Computing, LLC Device e100
             +-01.0-[01]--
             +-02.0-[02]--
             +-03.0-[03]--
             \-04.0-[04-05]--+-00.0  Intel Corporation Ethernet Controller 10G X550T
                             \-00.1  Intel Corporation Ethernet Controller 10G X550T

root@ampere:/home/cmic# lspci -s 0:0:0.0 -kvv
0000:00:00.0 Host bridge: Ampere Computing, LLC Device e100
        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-
        NUMA node: 0

root@ampere:/home/cmic# lspci -s 0:0:1.0 -k
0000:00:01.0 PCI bridge: Ampere Computing, LLC Device e101 (rev 04)
        Kernel driver in use: pcieport

谢谢!

相关内容