aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/device_const.c6
-rw-r--r--src/include/device/device.h9
2 files changed, 14 insertions, 1 deletions
diff --git a/src/device/device_const.c b/src/device/device_const.c
index 5143563a87..27197f251c 100644
--- a/src/device/device_const.c
+++ b/src/device/device_const.c
@@ -24,6 +24,12 @@ DEVTREE_CONST struct device * DEVTREE_CONST all_devices = &dev_root;
/**
* Given a PCI bus and a devfn number, find the device structure.
*
+ * 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).
+ *
* @param bus The bus number.
* @param devfn A device/function number.
* @return Pointer to the device structure (if found), 0 otherwise.
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);