]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: vmd: Switch to pci_bus_find_emul_domain_nr()
authorDan Williams <dan.j.williams@intel.com>
Fri, 24 Oct 2025 22:46:22 +0000 (15:46 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 28 Oct 2025 17:38:06 +0000 (12:38 -0500)
commitb37b6095a94e1ccecac80c9f1a8fca8d72919c65
treede6ef2088a1f3b116109e77df72c9c5b839de444
parentbcce8c74f1ce1e2731ac0261287897e3768767d8
PCI: vmd: Switch to pci_bus_find_emul_domain_nr()

The new common domain number allocator can replace the custom allocator
in VMD.

Beyond some code reuse benefits it does close a potential race whereby
vmd_find_free_domain() collides with new PCI buses coming online with a
conflicting domain number. Such a race has not been observed in practice,
hence not tagging this change as a fix.

As VMD uses pci_create_root_bus() rather than pci_alloc_host_bridge() +
pci_scan_root_bus_bridge() it has no chance to set ->domain_nr in the
bridge so needs to manage freeing the domain number on its own.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Szymon Durawa <szymon.durawa@linux.intel.com>
Cc: Nirmal Patel <nirmal.patel@linux.intel.com>
Link: https://patch.msgid.link/20251024224622.1470555-3-dan.j.williams@intel.com
drivers/pci/controller/vmd.c