[PATCH v6 02/11] virtio: Ensure PCI is set up first

Simon Glass sjg at chromium.org
Sat Apr 1 23:45:26 CEST 2023


Sometimes virtio may rely on PCI, or at least that is what the
distro_bootcmd script suggests. Add this in.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v5)

Changes in v5:
Add new patch to ensure PCI is set up first

 drivers/virtio/virtio-uclass.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c
index de9bc90359ca..918cc15b019f 100644
--- a/drivers/virtio/virtio-uclass.c
+++ b/drivers/virtio/virtio-uclass.c
@@ -373,6 +373,12 @@ static int virtio_bootdev_hunt(struct bootdev_hunter *info, bool show)
 {
 	int ret;
 
+	if (IS_ENABLED(CONFIG_PCI)) {
+		ret = uclass_probe_all(UCLASS_PCI);
+		if (ret && ret != -ENOENT)
+			return log_msg_ret("pci", ret);
+	}
+
 	ret = uclass_probe_all(UCLASS_VIRTIO);
 	if (ret && ret != -ENOENT)
 		return log_msg_ret("vir", ret);
-- 
2.40.0.348.gf938b09366-goog



More information about the U-Boot mailing list