mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 1/3] virtio: ring: fix stale data in queue after reset
@ 2026-01-12  8:55 Ahmad Fatoum
  2026-01-12  8:55 ` [PATCH master 2/3] scripts: Makefile.lib: suppress graph_port warnings for overlays Ahmad Fatoum
  2026-01-12  8:55 ` [PATCH master 3/3] ARM: Rockchip: rk3576-prtpuk: suppress video graph warning Ahmad Fatoum
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2026-01-12  8:55 UTC (permalink / raw)
  To: barebox; +Cc: Claude, Ahmad Fatoum

When resetting barebox for QEMU Virt or chainloading it, the log is
spammed with:

  virtio_net virtio1: id 65536 out of range

This is because we have two ways to allocate the vrings, either via
dma_alloc_coherent or memalign and the latter doesn't zero the queues.

A better fix that makes use of the DMA APIs unconditionally will follow
in a later release.

Co-developed-by: Claude <noreply@claude.ai>
[ahmad: Claude was pointed at QEMU, Linux and U-Boot implementations
 and found the discrepancy, but had a different less efficient fix]

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 drivers/virtio/virtio_ring.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index c1c84e49615f..8b6469f54d2a 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -369,6 +369,8 @@ static void *vring_alloc_queue(struct virtio_device *vdev,
 			phys_addr_t phys_addr = virt_to_phys(queue);
 			*dma_handle = (dma_addr_t)phys_addr;
 
+			memset(queue, 0x00, PAGE_ALIGN(size));
+
 			/*
 			 * Sanity check: make sure we dind't truncate
 			 * the address.  The only arches I can find that
-- 
2.47.3




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-12  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-12  8:55 [PATCH master 1/3] virtio: ring: fix stale data in queue after reset Ahmad Fatoum
2026-01-12  8:55 ` [PATCH master 2/3] scripts: Makefile.lib: suppress graph_port warnings for overlays Ahmad Fatoum
2026-01-12  8:55 ` [PATCH master 3/3] ARM: Rockchip: rk3576-prtpuk: suppress video graph warning Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox