From: Bin Meng <bin.meng@processmission.com>
To: U-Boot Mailing List <u-boot@lists.u-boot-project.org>
Cc: Bin Meng <bmeng.cn@gmail.com>,
Kuan-Wei Chiu <visitorckw@gmail.com>,
Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Subject: [PATCH 5/8] virtio: 9p: Reset the device before releasing its queues
Date: Thu, 15 Oct 2026 19:13:20 +0800 [thread overview]
Message-ID: <20261015111328.1269775-6-bin.meng@processmission.com> (raw)
In-Reply-To: <20261015111328.1269775-1-bin.meng@processmission.com>
The 9P remove callback frees virtqueues while the device can still
access them, then resets the device. Outstanding requests can therefore
race with freeing the ring memory.
Use the common reset helper, which waits for the device to stop before
releasing its queues.
Signed-off-by: Bin Meng <bin.meng@processmission.com>
---
drivers/virtio/virtio_9p.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/virtio/virtio_9p.c b/drivers/virtio/virtio_9p.c
index fb2eb0c7223..d0fb39a1de5 100644
--- a/drivers/virtio/virtio_9p.c
+++ b/drivers/virtio/virtio_9p.c
@@ -102,19 +102,13 @@ static int virtio_9p_probe(struct udevice *dev)
return 0;
}
-static int virtio_9p_remove(struct udevice *dev)
-{
- virtio_del_vqs(dev);
- return virtio_reset(dev);
-}
-
U_BOOT_DRIVER(virtio_9p) = {
.name = VIRTIO_9P_DRV_NAME,
.id = UCLASS_9P,
.ops = &virtio_9p_ops,
.bind = virtio_9p_bind,
.probe = virtio_9p_probe,
- .remove = virtio_9p_remove,
+ .remove = virtio_reset,
.priv_auto = sizeof(struct virtio_9p_priv),
.flags = DM_FLAG_ACTIVE_DMA,
};
--
2.53.0
next prev parent reply other threads:[~2026-10-15 13:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 11:13 [PATCH 0/8] virtio: Fix virtqueue teardown and probe cleanup Bin Meng
2026-10-15 11:13 ` [PATCH 1/8] virtio: mmio: Fix private data lookup when deleting queues Bin Meng
2026-10-15 11:13 ` [PATCH 2/8] virtio: pci: Fix legacy " Bin Meng
2026-10-15 11:13 ` [PATCH 3/8] virtio: pci: Fix modern " Bin Meng
2026-10-15 11:13 ` [PATCH 4/8] virtio: Release virtqueues after device reset Bin Meng
2026-10-15 11:13 ` Bin Meng [this message]
2026-10-15 11:13 ` [PATCH 6/8] virtio: blk: Validate configuration before creating the virtqueue Bin Meng
2026-10-15 11:13 ` [PATCH 7/8] MAINTAINERS: Cover all virtio driver-model tests Bin Meng
2026-10-15 11:18 ` Quentin Schulz
2026-10-15 11:13 ` [PATCH 8/8] test: dm: Check virtio queue cleanup on device removal Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261015111328.1269775-6-bin.meng@processmission.com \
--to=bin.meng@processmission.com \
--cc=bmeng.cn@gmail.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=visitorckw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.