CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:25:28 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: if_hvn.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1460):

sys/dev/hyperv/if_hvn.c: revision 1.11

hvn(4): Fix incorrect ident when waiting for NVS command response.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.6 -r1.2.2.7 src/sys/dev/hyperv/if_hvn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 26 08:25:28 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: if_hvn.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1460):

sys/dev/hyperv/if_hvn.c: revision 1.11

hvn(4): Fix incorrect ident when waiting for NVS command response.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.6 -r1.2.2.7 src/sys/dev/hyperv/if_hvn.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/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.2.2.6 src/sys/dev/hyperv/if_hvn.c:1.2.2.7
--- src/sys/dev/hyperv/if_hvn.c:1.2.2.6	Mon Nov 25 16:01:25 2019
+++ src/sys/dev/hyperv/if_hvn.c	Tue Nov 26 08:25:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.2.2.6 2019/11/25 16:01:25 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.2.2.7 2019/11/26 08:25:28 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.6 2019/11/25 16:01:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.7 2019/11/26 08:25:28 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1103,7 +1103,8 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 			hvn_nvs_intr(sc);
 			splx(s);
 		} else
-			tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1));
+			tsleep(sc->sc_nvsrsp, PRIBIO | PCATCH, "nvscmd",
+			mstohz(1));
 	} while (--timo > 0 && sc->sc_nvsdone != 1);
 
 	if (timo == 0 && sc->sc_nvsdone != 1) {



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:01:25 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvs.c if_hvn.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1458):

sys/dev/hyperv/hvs.c: revision 1.3
sys/dev/hyperv/if_hvn.c: revision 1.10

hvs(4), hvn(4): Set correct size for bus_dmamap_sync(9).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/hyperv/hvs.c
cvs rdiff -u -r1.2.2.5 -r1.2.2.6 src/sys/dev/hyperv/if_hvn.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/hyperv/hvs.c
diff -u src/sys/dev/hyperv/hvs.c:1.1.2.2 src/sys/dev/hyperv/hvs.c:1.1.2.3
--- src/sys/dev/hyperv/hvs.c:1.1.2.2	Sat Mar  9 17:10:19 2019
+++ src/sys/dev/hyperv/hvs.c	Mon Nov 25 16:01:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hvs.c,v 1.1.2.2 2019/03/09 17:10:19 martin Exp $	*/
+/*	$NetBSD: hvs.c,v 1.1.2.3 2019/11/25 16:01:25 martin Exp $	*/
 /*	$OpenBSD: hvs.c,v 1.17 2017/08/10 17:22:48 mikeb Exp $	*/
 
 /*-
@@ -37,7 +37,7 @@
 /* #define HVS_DEBUG_IO */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hvs.c,v 1.1.2.2 2019/03/09 17:10:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hvs.c,v 1.1.2.3 2019/11/25 16:01:25 martin Exp $");
 
 #include 
 #include 
@@ -1095,7 +1095,8 @@ hvs_free_ccbs(struct hvs_softc *sc)
 		if (ccb->ccb_dmap == NULL)
 			continue;
 
-		bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmap, 0, 0,
+		bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmap,
+		0, ccb->ccb_dmap->dm_mapsize,
 		BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 		bus_dmamap_unload(sc->sc_dmat, ccb->ccb_dmap);
 		bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmap);

Index: src/sys/dev/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.2.2.5 src/sys/dev/hyperv/if_hvn.c:1.2.2.6
--- src/sys/dev/hyperv/if_hvn.c:1.2.2.5	Sun Nov 24 08:11:06 2019
+++ src/sys/dev/hyperv/if_hvn.c	Mon Nov 25 16:01:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.2.2.6 2019/11/25 16:01:25 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.6 2019/11/25 16:01:25 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -638,7 +638,8 @@ hvn_decap(struct hvn_softc *sc, struct h
 {
 	struct ifnet *ifp = SC2IFP(sc);
 
-	bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap, 0, 0,
+	bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap,
+	0, txd->txd_dmap->dm_mapsize,
 	BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 	bus_dmamap_unload(sc->sc_dmat, txd->txd_dmap);
 	txd->txd_buf = NULL;
@@ -673,7 +674,8 @@ hvn_txeof(struct hvn_softc *sc, uint64_t
 	}
 	txd->txd_buf = NULL;
 
-	bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap, 0, 0,
+	bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap,
+	0, txd->txd_dmap->dm_mapsize,
 	BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 	bus_dmamap_unload(sc->sc_dmat, txd->txd_dmap);
 	m_freem(m);
@@ -850,7 +852,8 @@ hvn_tx_ring_destroy(struct hvn_softc *sc
 		txd = >sc_tx_desc[i];
 		if (txd->txd_dmap == NULL)
 			continue;
-		bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap, 0, 0,
+		bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap,
+		0, txd->txd_dmap->dm_mapsize,
 		BUS_DMASYNC_POSTWRITE);
 		bus_dmamap_unload(sc->sc_dmat, txd->txd_dmap);
 		bus_dmamap_destroy(sc->sc_dmat, txd->txd_dmap);
@@ -861,7 +864,8 @@ hvn_tx_ring_destroy(struct hvn_softc *sc
 		txd->txd_buf = NULL;
 	}
 	if (sc->sc_tx_rmap) {
-		bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap, 0, 0,
+		bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap,
+		0, txd->txd_dmap->dm_mapsize,
 		BUS_DMASYNC_POSTWRITE);
 		bus_dmamap_unload(sc->sc_dmat, sc->sc_tx_rmap);
 		bus_dmamap_destroy(sc->sc_dmat, sc->sc_tx_rmap);



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:01:25 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvs.c if_hvn.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1458):

sys/dev/hyperv/hvs.c: revision 1.3
sys/dev/hyperv/if_hvn.c: revision 1.10

hvs(4), hvn(4): Set correct size for bus_dmamap_sync(9).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/hyperv/hvs.c
cvs rdiff -u -r1.2.2.5 -r1.2.2.6 src/sys/dev/hyperv/if_hvn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:11:06 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvkbd.c if_hvn.c vmbus.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1455):

sys/dev/hyperv/if_hvn.c: revision 1.8
sys/dev/hyperv/if_hvn.c: revision 1.9
sys/dev/hyperv/hvkbd.c: revision 1.5
sys/dev/hyperv/hvkbd.c: revision 1.6
sys/dev/hyperv/vmbus.c: revision 1.5

vmbus(4), hvn(4), hvkbd(4): Fixed wait time for tsleep(9).
hvn(4), hvkbd(4): Only need to poll when cold.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.5 -r1.1.4.6 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.2.2.4 -r1.2.2.5 src/sys/dev/hyperv/if_hvn.c \
src/sys/dev/hyperv/vmbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:11:06 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvkbd.c if_hvn.c vmbus.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1455):

sys/dev/hyperv/if_hvn.c: revision 1.8
sys/dev/hyperv/if_hvn.c: revision 1.9
sys/dev/hyperv/hvkbd.c: revision 1.5
sys/dev/hyperv/hvkbd.c: revision 1.6
sys/dev/hyperv/vmbus.c: revision 1.5

vmbus(4), hvn(4), hvkbd(4): Fixed wait time for tsleep(9).
hvn(4), hvkbd(4): Only need to poll when cold.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.5 -r1.1.4.6 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.2.2.4 -r1.2.2.5 src/sys/dev/hyperv/if_hvn.c \
src/sys/dev/hyperv/vmbus.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/hyperv/hvkbd.c
diff -u src/sys/dev/hyperv/hvkbd.c:1.1.4.5 src/sys/dev/hyperv/hvkbd.c:1.1.4.6
--- src/sys/dev/hyperv/hvkbd.c:1.1.4.5	Sat Nov 16 16:23:31 2019
+++ src/sys/dev/hyperv/hvkbd.c	Sun Nov 24 08:11:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hvkbd.c,v 1.1.4.5 2019/11/16 16:23:31 martin Exp $	*/
+/*	$NetBSD: hvkbd.c,v 1.1.4.6 2019/11/24 08:11:06 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017 Microsoft Corp.
@@ -36,7 +36,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.1.4.5 2019/11/16 16:23:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.1.4.6 2019/11/24 08:11:06 martin Exp $");
 
 #include 
 #include 
@@ -357,13 +357,13 @@ hvkbd_connect(struct hvkbd_softc *sc)
 	}
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", 1);
-		s = spltty();
-		hvkbd_intr(sc);
-		splx(s);
+			s = spltty();
+			hvkbd_intr(sc);
+			splx(s);
+		} else
+			tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", mstohz(1));
 	} while (--timo > 0 && sc->sc_connected == 0);
 
 	if (timo == 0 && sc->sc_connected == 0) {

Index: src/sys/dev/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.2.2.4 src/sys/dev/hyperv/if_hvn.c:1.2.2.5
--- src/sys/dev/hyperv/if_hvn.c:1.2.2.4	Mon Nov 18 19:27:56 2019
+++ src/sys/dev/hyperv/if_hvn.c	Sun Nov 24 08:11:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.2.2.4 2019/11/18 19:27:56 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.4 2019/11/18 19:27:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1075,7 +1075,7 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 			if (cold)
 delay(1000);
 			else
-tsleep(cmd, PRIBIO, "nvsout", 1);
+tsleep(cmd, PRIBIO, "nvsout", mstohz(1));
 		} else if (rv) {
 			DPRINTF("%s: NVSP operation %u send error %d\n",
 			device_xname(sc->sc_dev), hdr->nvs_type, rv);
@@ -1093,13 +1093,13 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 		return 0;
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(sc, PRIBIO | PCATCH, "nvscmd", 1);
-		s = splnet();
-		hvn_nvs_intr(sc);
-		splx(s);
+			s = splnet();
+			hvn_nvs_intr(sc);
+			splx(s);
+		} else
+			tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1));
 	} while (--timo > 0 && sc->sc_nvsdone != 1);
 
 	if (timo == 0 && sc->sc_nvsdone != 1) {
@@ -1397,7 +1397,7 @@ hvn_rndis_cmd(struct hvn_softc *sc, stru
 			if (cold)
 delay(1000);
 			else
-tsleep(rc, PRIBIO, "rndisout", 1);
+tsleep(rc, PRIBIO, "rndisout", mstohz(1));
 		} else if (rv) {
 			DPRINTF("%s: RNDIS operation %u send error %d\n",
 			device_xname(sc->sc_dev), hdr->rm_type, rv);
@@ -1416,13 +1416,13 @@ hvn_rndis_cmd(struct hvn_softc *sc, stru
 	BUS_DMASYNC_POSTWRITE);
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(rc, PRIBIO | PCATCH, "rndiscmd", 1);
-		s = splnet();
-		hvn_nvs_intr(sc);
-		splx(s);
+			s = splnet();
+			hvn_nvs_intr(sc);
+			splx(s);
+		} else
+			tsleep(rc, PRIBIO | PCATCH, "rndiscmd", mstohz(1));
 	} while (--timo > 0 && rc->rc_done != 1);
 
 	bus_dmamap_sync(sc->sc_dmat, rc->rc_dmap, 0, PAGE_SIZE,
Index: src/sys/dev/hyperv/vmbus.c
diff -u src/sys/dev/hyperv/vmbus.c:1.2.2.4 src/sys/dev/hyperv/vmbus.c:1.2.2.5
--- src/sys/dev/hyperv/vmbus.c:1.2.2.4	Tue Jul  9 15:16:45 2019
+++ src/sys/dev/hyperv/vmbus.c	Sun Nov 24 08:11:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmbus.c,v 1.2.2.4 2019/07/09 15:16:45 martin Exp $	*/
+/*	$NetBSD: vmbus.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $	*/
 /*	$OpenBSD: hyperv.c,v 1.43 2017/06/27 13:56:15 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.2.2.4 2019/07/09 15:16:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $");
 
 #include 
 #include 
@@ -604,7 +604,7 @@ 

CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 18 19:27:56 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: if_hvn.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1447):

sys/dev/hyperv/if_hvn.c: revision 1.7

Fixed incorrect m_defrag return value check.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.3 -r1.2.2.4 src/sys/dev/hyperv/if_hvn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 16:23:31 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvkbd.c if_hvn.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1441):

sys/dev/hyperv/if_hvn.c: revision 1.6
sys/dev/hyperv/hvkbd.c: revision 1.4

hvn(4), hvkbd(4): No need to call vmbus_channel_setdeferred().

These devices do not perform batch reading.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.4 -r1.1.4.5 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/dev/hyperv/if_hvn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-11-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Nov 16 16:23:31 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvkbd.c if_hvn.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1441):

sys/dev/hyperv/if_hvn.c: revision 1.6
sys/dev/hyperv/hvkbd.c: revision 1.4

hvn(4), hvkbd(4): No need to call vmbus_channel_setdeferred().

These devices do not perform batch reading.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.4 -r1.1.4.5 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/dev/hyperv/if_hvn.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/hyperv/hvkbd.c
diff -u src/sys/dev/hyperv/hvkbd.c:1.1.4.4 src/sys/dev/hyperv/hvkbd.c:1.1.4.5
--- src/sys/dev/hyperv/hvkbd.c:1.1.4.4	Thu Jun 13 06:12:55 2019
+++ src/sys/dev/hyperv/hvkbd.c	Sat Nov 16 16:23:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hvkbd.c,v 1.1.4.4 2019/06/13 06:12:55 martin Exp $	*/
+/*	$NetBSD: hvkbd.c,v 1.1.4.5 2019/11/16 16:23:31 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017 Microsoft Corp.
@@ -36,7 +36,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.1.4.4 2019/06/13 06:12:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.1.4.5 2019/11/16 16:23:31 martin Exp $");
 
 #include 
 #include 
@@ -216,12 +216,6 @@ hvkbd_attach(device_t parent, device_t s
 		return;
 	}
 
-	if (vmbus_channel_setdeferred(sc->sc_chan, device_xname(self))) {
-		aprint_error_dev(self,
-		"failed to create the interrupt thread\n");
-		goto free_buf;
-	}
-
 	sc->sc_chan->ch_flags &= ~CHF_BATCHED;
 	if (vmbus_channel_open(sc->sc_chan,
 	HVKBD_TX_RING_SIZE + HVKBD_RX_RING_SIZE, NULL, 0, hvkbd_intr, sc)) {

Index: src/sys/dev/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.2.2.2 src/sys/dev/hyperv/if_hvn.c:1.2.2.3
--- src/sys/dev/hyperv/if_hvn.c:1.2.2.2	Sat Mar  9 17:10:19 2019
+++ src/sys/dev/hyperv/if_hvn.c	Sat Nov 16 16:23:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.2.2.2 2019/03/09 17:10:19 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.2.2.3 2019/11/16 16:23:31 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.2 2019/03/09 17:10:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.3 2019/11/16 16:23:31 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -934,12 +934,6 @@ hvn_nvs_attach(struct hvn_softc *sc)
 
 	sc->sc_chan->ch_flags &= ~CHF_BATCHED;
 
-	if (vmbus_channel_setdeferred(sc->sc_chan, device_xname(sc->sc_dev))) {
-		aprint_error_dev(sc->sc_dev,
-		"failed to create the interrupt thread\n");
-		return -1;
-	}
-
 	/* Associate our interrupt handler with the channel */
 	if (vmbus_channel_open(sc->sc_chan, ringsize, NULL, 0,
 	hvn_nvs_intr, sc)) {



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-07-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul  9 15:16:45 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: vmbus.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1286):

sys/dev/hyperv/vmbus.c: revision 1.4

Zero clear the allocated ring buffer for vmbus_channel.
This change makes Hyper-V's vmbus devices work properly even after reboot.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.3 -r1.2.2.4 src/sys/dev/hyperv/vmbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-8] src/sys/dev/hyperv

2019-07-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul  9 15:16:45 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: vmbus.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1286):

sys/dev/hyperv/vmbus.c: revision 1.4

Zero clear the allocated ring buffer for vmbus_channel.
This change makes Hyper-V's vmbus devices work properly even after reboot.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.3 -r1.2.2.4 src/sys/dev/hyperv/vmbus.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/hyperv/vmbus.c
diff -u src/sys/dev/hyperv/vmbus.c:1.2.2.3 src/sys/dev/hyperv/vmbus.c:1.2.2.4
--- src/sys/dev/hyperv/vmbus.c:1.2.2.3	Wed Jun 12 10:17:32 2019
+++ src/sys/dev/hyperv/vmbus.c	Tue Jul  9 15:16:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmbus.c,v 1.2.2.3 2019/06/12 10:17:32 martin Exp $	*/
+/*	$NetBSD: vmbus.c,v 1.2.2.4 2019/07/09 15:16:45 martin Exp $	*/
 /*	$OpenBSD: hyperv.c,v 1.43 2017/06/27 13:56:15 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.2.2.3 2019/06/12 10:17:32 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.2.2.4 2019/07/09 15:16:45 martin Exp $");
 
 #include 
 #include 
@@ -1263,6 +1263,7 @@ vmbus_channel_ring_create(struct vmbus_c
 		"failed to allocate channel ring\n");
 		return ENOMEM;
 	}
+	memset(ch->ch_ring, 0, ch->ch_ring_size);
 
 	memset(>ch_wrd, 0, sizeof(ch->ch_wrd));
 	ch->ch_wrd.rd_ring = (struct vmbus_bufring *)ch->ch_ring;