Module Name: src
Committed By: martin
Date: Wed Aug 7 11:05:22 UTC 2024
Modified Files:
src/sys/dev/virtio [netbsd-10]: viocon.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #778):
sys/dev/virtio/viocon.c: revision 1.10
viocon(4): Defer viocon_rx_fill til after virtio_child_attach_finish.
Since virtio.c 1.66, virtqueue_enqueue* can't be used until after
virtio_child_attach_finish completes.
https://mail-index.netbsd.org/source-changes/2023/03/23/msg143799.html
PR kern/58555: Kernel panic during boot when using viocon with PCIe
To generate a diff of this commit:
cvs rdiff -u -r1.5.4.1 -r1.5.4.2 src/sys/dev/virtio/viocon.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/virtio/viocon.c
diff -u src/sys/dev/virtio/viocon.c:1.5.4.1 src/sys/dev/virtio/viocon.c:1.5.4.2
--- src/sys/dev/virtio/viocon.c:1.5.4.1 Sat May 13 10:56:10 2023
+++ src/sys/dev/virtio/viocon.c Wed Aug 7 11:05:22 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: viocon.c,v 1.5.4.1 2023/05/13 10:56:10 martin Exp $ */
+/* $NetBSD: viocon.c,v 1.5.4.2 2024/08/07 11:05:22 martin Exp $ */
/* $OpenBSD: viocon.c,v 1.8 2021/11/05 11:38:29 mpi Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viocon.c,v 1.5.4.1 2023/05/13 10:56:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viocon.c,v 1.5.4.2 2024/08/07 11:05:22 martin Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -222,12 +222,13 @@ viocon_attach(struct device *parent, str
printf("\n%s: viocon_port_create failed\n", __func__);
goto err;
}
- viocon_rx_fill(sc->sc_ports[0]);
if (virtio_child_attach_finish(vsc, sc->sc_vqs, nvqs,
/*config_change*/NULL, /*req_flags*/0) != 0)
goto err;
+ viocon_rx_fill(sc->sc_ports[0]);
+
return;
err:
kmem_free(sc->sc_vqs, nvqs * sizeof(sc->sc_vqs[0]));