Bug 218255

Summary: Hot-adding SCSI disk in QEMU VM fails
Product: Drivers Reporter: Bjorn Helgaas (bjorn)
Component: PCIAssignee: drivers_pci (drivers_pci)
Status: NEW ---    
Severity: high CC: dongli.zhang, f.ebner, imammedo
Priority: P3    
Hardware: All   
OS: Linux   
URL: https://lore.kernel.org/r/9eb669c0-d8f2-431d-a700-6da13053ae54@proxmox.com
Kernel Version: v6.5 Subsystem:
Regression: Yes Bisected commit-id: cc22522fd55e2 ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus")
Attachments: v6.7.0-rc3 dmesg log, fails
v6.7.0-rc3+reverts dmesg log, works
v6.7.0-rc3 dmesg log, works

Description Bjorn Helgaas 2023-12-11 16:12:28 UTC
Fiona Ebner <f.ebner@proxmox.com> reported that "hot-plugging SCSI disks for QEMU virtual machines booting with UEFI and with guest kernels >= 6.5 might be broken. It's not consistently broken, hinting there might be a race somewhere."

Reverting the following two commits seems to make it work reliably again:

cc22522fd55e2 ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus")
40613da52b13f ("PCI: acpiphp: Reassign resources on bridge if necessary"
Comment 2 Fiona Ebner 2023-12-12 09:30:10 UTC
Created attachment 305592 [details]
v6.7.0-rc3+reverts dmesg log, works
Comment 3 Fiona Ebner 2023-12-12 09:37:57 UTC
Created attachment 305593 [details]
v6.7.0-rc3 dmesg log, works

The problem does not happen consistently, but it is racy. This is for a run without the reverts where the issue didn't trigger by chance.
Comment 4 Dongli Zhang 2023-12-12 20:57:19 UTC
There is another report.

[Regression report] commit 40613da52b13 ("PCI: acpiphp: Reassign resources on bridge if necessary")

https://lore.kernel.org/all/3c4a446a-b167-11b8-f36f-d3c1b49b42e9@oracle.com/

Thank you very much!