Skip to content

Commit 495ae42

Browse files
Pull up following revision(s) (requested by riastradh in ticket NetBSD#63):
sys/dev/pci/pvscsi.c: revision 1.3 pvscsi(4): Use paravirt_membar_sync(9) where needed. PR kern/59618: occasional virtio block device lock ups/hangs (pvscsi(4) is not virtio(4) but the same fundamental issue arises.)
1 parent 9d7625c commit 495ae42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sys/dev/pci/pvscsi.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ in the file called LICENSE.GPL.
5959
*/
6060

6161
#include <sys/cdefs.h>
62-
__KERNEL_RCSID(0, "$NetBSD: pvscsi.c,v 1.2.2.2 2025/08/08 14:19:54 martin Exp $");
62+
__KERNEL_RCSID(0, "$NetBSD: pvscsi.c,v 1.2.2.3 2025/10/19 11:09:18 martin Exp $");
6363

6464
#include <sys/param.h>
6565

@@ -70,6 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: pvscsi.c,v 1.2.2.2 2025/08/08 14:19:54 martin Exp $"
7070
#include <sys/device.h>
7171
#include <sys/kernel.h>
7272
#include <sys/kmem.h>
73+
#include <sys/paravirt_membar.h>
7374
#include <sys/queue.h>
7475
#include <sys/sysctl.h>
7576
#include <sys/systm.h>
@@ -380,6 +381,12 @@ pvscsi_kick_io(struct pvscsi_softc *sc, uint8_t cdb0)
380381
cdb0 == WRITE_12 || cdb0 == WRITE_16) {
381382
s = sc->rings_state;
382383

384+
/*
385+
* Ensure the command has been published before we test
386+
* whether we need to kick the host.
387+
*/
388+
paravirt_membar_sync();
389+
383390
DEBUG_PRINTF(2, sc->dev, "%s req prod %d cons %d\n", __func__,
384391
s->req_prod_idx, s->req_cons_idx);
385392
if (!sc->use_req_call_threshold ||

0 commit comments

Comments
 (0)