Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35632 )
Change subject: device: add commentary to dev_find_slot() ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35632/1/src/device/device_const.c File src/device/device_const.c:
https://review.coreboot.org/c/coreboot/+/35632/1/src/device/device_const.c@2... PS1, Line 236: DEVTREE_CONST struct device *pcidev_path_on_root_debug(pci_devfn_t devfn, const char *func)
Can't we provide a variant that supplies bus number? Go through dev_root->link_list to find those devices/buses?
IMO we should not support API to search for a device on a specific bus number as we already have pcidev_path_behind(). Even that function is questionable, it can return devices behind bridges before said bridge has had secondary and subordinate bus numbers assigned. In other words, PCI configuration writes would not go through.
Or am I misunderstanding the AMDFAM10 issue? If I am could you elaborate on it further for me, please?
There is something more, but nobody showing active interest to debug it or in general tidy up that AMDFAM10 codebase. Those dev_find_slot() calls all appear to be pre-devicetree PCI topology tracking.