From 965020c3f7e11a8ee4f53023822d30d43345abde Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 28 Jan 2023 15:00:19 -0700 Subject: bootstd: Probe the block device before use In some cases the block device is obtained but is not probed, since it is a sibling of the bootdev. Make sure it is probed, so it can be used without any trouble. This fixes a bug with virtio, where the device is accessed before it has been set up by the virtio uclass. Signed-off-by: Simon Glass Fixes: 201417d700a ("bootstd: Add the bootdev uclass") Reported-by: Ilias Apalodimas --- boot/bootdev-uclass.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'boot/bootdev-uclass.c') diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 99ee08e3353..8103a11d1bb 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -309,6 +309,9 @@ int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp) if (ret) return log_msg_ret("find", ret); } + ret = device_probe(blk); + if (ret) + return log_msg_ret("act", ret); *blkp = blk; return 0; -- cgit v1.2.3