-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
rhel-9.6
-
No
-
Low
-
1
-
rhel-sst-virtualization
-
ssg_virtualization
-
5
-
False
-
-
None
-
Virt ARM 24-1
-
None
-
None
-
-
aarch64
-
None
What were you trying to do that didn't work?
Boot guest, with Upstream Port and Downstream Port topology
Hot plug Downstream Port device failed
[ 121.833021] pcieport 0000:08:01.0: pciehp: Slot(2): Cannot train link: status 0x2000
Please provide the package NVR for which the bug is seen:
qemu-kvm-9.1.0-1.el9
5.14.0-523.el9.aarch64
edk2-aarch64-20240524-7.el9.noarch
How reproducible is this bug?:
100%
Steps to reproduce
1. Boot guest, with Upstream Port and Downstream Port topology
/usr/libexec/qemu-kvm \ -name 'avocado-vt-vm1' \ -sandbox on \ -blockdev '{"node-name": "file_aavmf_code", "driver": "file", "filename": "/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.qcow2", "auto-read-only": true, "discard": "unmap"}' \ -blockdev '{"node-name": "drive_aavmf_code", "driver": "qcow2", "read-only": true, "file": "file_aavmf_code"}' \ -blockdev '{"node-name": "file_aavmf_vars", "driver": "file", "filename": "/home/kar/workspace/root/avocado/data/avocado-vt/avocado-vt-vm1_rhel960-aarch64-4k-virtio-scsi_qcow2_filesystem_VARS.qcow2", "auto-read-only": true, "discard": "unmap"}' \ -blockdev '{"node-name": "drive_aavmf_vars", "driver": "qcow2", "read-only": false, "file": "file_aavmf_vars"}' \ -machine virt,gic-version=host,pflash0=drive_aavmf_code,pflash1=drive_aavmf_vars,memory-backend=mem-machine_mem \ -device '{"id": "pcie-root-port-0", "driver": "pcie-root-port", "multifunction": true, "bus": "pcie.0", "addr": "0x1", "chassis": 1}' \ -device '{"id": "pcie-pci-bridge-0", "driver": "pcie-pci-bridge", "addr": "0x0", "bus": "pcie-root-port-0"}' \ -nodefaults \ -device '{"id": "pcie-root-port-1", "port": 1, "driver": "pcie-root-port", "addr": "0x1.0x1", "bus": "pcie.0", "chassis": 2}' \ -device '{"driver": "virtio-gpu-pci", "bus": "pcie-root-port-1", "addr": "0x0"}' \ -m 8192 \ -object '{"size": 8589934592, "id": "mem-machine_mem", "qom-type": "memory-backend-ram"}' \ -smp 24,maxcpus=24,cores=12,threads=1,clusters=1,sockets=2 \ -cpu 'host' \ -chardev socket,wait=off,path=/var/tmp/monitor-qmpmonitor1,server=on,id=qmp_id_qmpmonitor1 \ -mon chardev=qmp_id_qmpmonitor1,mode=control \ -serial unix:'/var/tmp/serial-serial0',server=on,wait=off \ -device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}' \ -device '{"driver": "qemu-xhci", "id": "usb1", "bus": "pcie-root-port-2", "addr": "0x0"}' \ -device '{"driver": "usb-tablet", "id": "usb-tablet1", "bus": "usb1.0", "port": "1"}' \ -device '{"id": "pcie-root-port-3", "port": 3, "driver": "pcie-root-port", "addr": "0x1.0x3", "bus": "pcie.0", "chassis": 4}' \ -device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "bus": "pcie-root-port-3", "addr": "0x0"}' \ -blockdev '{"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/rhel960-aarch64-4k-virtio-scsi.qcow2", "cache": {"direct": true, "no-flush": false}}' \ -blockdev '{"node-name": "drive_image1", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_image1"}' \ -device '{"driver": "scsi-hd", "id": "image1", "drive": "drive_image1", "bootindex": 0, "write-cache": "on"}' \ -device '{"id": "pcie-root-port-4", "port": 4, "driver": "pcie-root-port", "addr": "0x1.0x4", "bus": "pcie.0", "chassis": 5}' \ -device '{"driver": "virtio-net-pci", "mac": "9a:82:0b:24:ad:54", "rombar": 0, "id": "idzwyVpM", "netdev": "idQ8kBhU", "bus": "pcie-root-port-4", "addr": "0x0"}' \ -netdev tap,id=idQ8kBhU,vhost=on \ -device pcie-root-port,id=pcie-root-port-5,chassis=6,slot=5,bus=pcie.0,addr=0x1.0x5 \ -device x3130-upstream,id=upstream_port1,bus=pcie-root-port-5,addr=0x0 \ -device xio3130-downstream,id=downstream_port1,bus=upstream_port1,chassis=1,slot=1,addr=0x0 \ -device pci-testdev,id=test1,bus=downstream_port1,addr=0x0 \ -device xio3130-downstream,id=downstream_port2,bus=upstream_port1,chassis=2,slot=2,addr=0x1 \ -vnc :20 \ -rtc base=utc,clock=host \ -enable-kvm \ -monitor stdio
2. Hot plugging Downstream Port devices hit this issue:
[root@ampere-mtsnow-altramax-15 home]# lspci -vvs 0001:01:00.0 | grep Memory Region 2: Memory at 60000000 (64-bit, non-prefetchable) [size=8M] (qemu) device_add vfio-pci,host=0001:01:00.0,bus=pcie.down1 [ 120.642822] pcieport 0000:08:01.0: pciehp: Slot(2): Button press: will power on in 5 sec [ 120.643956] pcieport 0000:08:01.0: pciehp: Slot(2): Card present [ 120.644513] pcieport 0000:08:01.0: pciehp: Slot(2): Link Up [ 121.833021] pcieport 0000:08:01.0: pciehp: Slot(2): Cannot train link: status 0x2000
Other:
When I manually ignore the link negotiation status detection,
hot plugging can succeed. So the problem may be in the link negotiation.
[root@virt-mtsnow-02 linux.main]# git diff
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 736ad8baa2a5..66c44571f053 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -312,12 +312,14 @@ int pciehp_check_link_status(struct controller *ctrl) pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); +# if 0 /* ignore the link negotiation status */ if ((lnk_status & PCI_EXP_LNKSTA_LT) || !(lnk_status & PCI_EXP_LNKSTA_NLW)) { ctrl_info(ctrl, "Slot(%s): Cannot train link: status %#06x\n", slot_name(ctrl), lnk_status); return -1; } +#endif
- is cloned by
-
RHEL-65618 [RHEL10] Failed to hot add PCIe device behind xio3130 downstream
- Planning