diff options
author | Aaron Durbin <adurbin@chromium.org> | 2019-09-26 12:05:27 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2019-09-27 21:08:24 +0000 |
commit | 55ef0d25d32ecabfec7dcd425793f972cbca890d (patch) | |
tree | 59634eef620afd2436c3f1666d33596460cda73b /src/include | |
parent | 99655530110135ebf9eeaf3532d90c38fafd9ce9 (diff) |
device: add commentary to dev_find_slot()
dev_find_slot() can sometimes fail to return the desired device object
prior to full PCI enumeration. Comment the declaration and
implementation accordingly to help the user understand the problem and
avoid its usage.
Change-Id: I3fe1f24ff015d3e4f272323947f057e4c910186c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35632
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/device/device.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h index b2221ccea2..f24e4b2157 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -298,7 +298,14 @@ DEVTREE_CONST struct device *pcidev_path_on_bus(unsigned int bus, pci_devfn_t de DEVTREE_CONST struct device *pcidev_on_root(uint8_t dev, uint8_t fn); DEVTREE_CONST struct bus *pci_root_bus(void); -/* To be deprecated, avoid using. */ +/* To be deprecated, avoid using. + * + * Note that this function can return the incorrect device prior + * to PCI enumeration because the secondary field of the bus object + * is 0. The failing scenario is determined by the order of the + * devices in all_devices singly-linked list as well as the time + * when this function is called (secondary reflecting topology). + */ DEVTREE_CONST struct device *dev_find_slot(unsigned int bus, unsigned int devfn); DEVTREE_CONST struct device *pcidev_path_on_root_debug(pci_devfn_t devfn, const char *func); |