diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-29 01:00:17 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-02-06 21:04:53 +0300 |
commit | d472e93ab4d0e037990f2db33f014ac8fcbeac9d (patch) | |
tree | 464a39cb4cfe819e0a4c892008590989e454410d /drivers | |
parent | 4f6daaca0fa225e785bd8293d7c5c88d9ff0b1bd (diff) | |
download | u-boot-d472e93ab4d0e037990f2db33f014ac8fcbeac9d.tar.xz |
virtio: Add some debugging
When QEMU does not respond for some reason, it is helpful to have
debugging info to show. Add some.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/virtio/virtio_blk.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c index 30cfc56725..9581058286 100644 --- a/drivers/virtio/virtio_blk.c +++ b/drivers/virtio/virtio_blk.c @@ -4,6 +4,8 @@ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> */ +#define LOG_CATEGORY UCLASS_VIRTIO + #include <common.h> #include <blk.h> #include <dm.h> @@ -42,6 +44,8 @@ static ulong virtio_blk_do_req(struct udevice *dev, u64 sector, sgs[num_out + num_in++] = &data_sg; sgs[num_out + num_in++] = &status_sg; + log_debug("dev=%s, active=%d, priv=%p, priv->vq=%p\n", dev->name, + device_active(dev), priv, priv->vq); ret = virtqueue_add(priv->vq, sgs, num_out, num_in); if (ret) @@ -49,8 +53,10 @@ static ulong virtio_blk_do_req(struct udevice *dev, u64 sector, virtqueue_kick(priv->vq); + log_debug("wait..."); while (!virtqueue_get_buf(priv->vq, NULL)) ; + log_debug("done\n"); return status == VIRTIO_BLK_S_OK ? blkcnt : -EIO; } @@ -58,6 +64,7 @@ static ulong virtio_blk_do_req(struct udevice *dev, u64 sector, static ulong virtio_blk_read(struct udevice *dev, lbaint_t start, lbaint_t blkcnt, void *buffer) { + log_debug("read %s\n", dev->name); return virtio_blk_do_req(dev, start, blkcnt, buffer, VIRTIO_BLK_T_IN); } |