summaryrefslogtreecommitdiff
path: root/boot/bootflow.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-29 01:00:19 +0300
committerTom Rini <trini@konsulko.com>2023-02-06 21:04:53 +0300
commit965020c3f7e11a8ee4f53023822d30d43345abde (patch)
tree9b68cb04d70222160b14a19b8a2c781a0e19e728 /boot/bootflow.c
parent0041b1c09a6bae62df36116315b49f3dea7e118b (diff)
downloadu-boot-965020c3f7e11a8ee4f53023822d30d43345abde.tar.xz
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 <sjg@chromium.org> Fixes: 201417d700a ("bootstd: Add the bootdev uclass") Reported-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'boot/bootflow.c')
-rw-r--r--boot/bootflow.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/boot/bootflow.c b/boot/bootflow.c
index dc3f1f0c73..b8fa37ee2a 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -270,6 +270,10 @@ static int iter_incr(struct bootflow_iter *iter)
if (ret) {
bootflow_iter_set_dev(iter, NULL, 0);
} else {
+ /*
+ * Probe the bootdev. This does not probe any attached
+ * block device, since they are siblings
+ */
ret = device_probe(dev);
log_debug("probe %s %d\n", dev->name, ret);
if (!log_msg_ret("probe", ret))