On Thu, Jul 17, 2025 at 06:04:04PM -0400, Donald Dutile wrote: > > Implement pci_reachable_set() to efficiently compute a set of devices on > > the same bus that are "reachable" from a starting device. The meaning of > > reachability is defined by the caller through a callback function. > > > This comment made me review get_pci_alias_group(), which states in its description: > * Look for aliases to or from the given device for existing groups. DMA > * aliases are only supported on the same bus, therefore the search > * space is quite small > > So why does it do the for loop: > for_each_pci_dev(tmp) { > > vs getting the pdev->bus->devices -- list of devices on that bus, and only > scan that smaller list, vs all pci devices on the system? Because it can't access the required lock pci_bus_sem to use that list. The lock is only available within the PCI core itself which is why I moved a few functions over there so they can use the lock. > Could we move this to just before patch 11 where it is used? Yes > or could this be used to improve get_pci_alias_group() and get_pci_function_alias_group() ? IMHO it is not really worth the churn Jason