On 7/18/25 1:49 PM, Jason Gunthorpe wrote:
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.
ah, i see; it's only declared in drivers/pci/search.c, and it isn't
a semaphone in a per-bus struct. :-/
... so move the function to search.c ? /me runs...
I know, not worth the churn; already have 'polluted' iommu w/pci, but not vice-versa.
(although iommu-groups is really a bus-op (would be a different op, for say, platform devices going through another iommu).
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
Hey, your churning at the moment, so I figured you may want to churn some more! ;-)
just a comment/suggestion; not required.
Jason