Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/dev/hyperv Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/a1f3c6807fb7
branches:  netbsd-8
changeset: 461357:a1f3c6807fb7
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 24 08:11:06 2019 +0000

description:
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.

diffstat:

 sys/dev/hyperv/hvkbd.c  |  16 ++++++++--------
 sys/dev/hyperv/if_hvn.c |  32 ++++++++++++++++----------------
 sys/dev/hyperv/vmbus.c  |   9 +++++----
 3 files changed, 29 insertions(+), 28 deletions(-)

diffs (151 lines):

diff -r a8e20936439b -r a1f3c6807fb7 sys/dev/hyperv/hvkbd.c
--- a/sys/dev/hyperv/hvkbd.c    Thu Nov 21 14:07:52 2019 +0000
+++ b/sys/dev/hyperv/hvkbd.c    Sun Nov 24 08:11:06 2019 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/systm.h>
@@ -357,13 +357,13 @@
        }
 
        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) {
diff -r a8e20936439b -r a1f3c6807fb7 sys/dev/hyperv/if_hvn.c
--- a/sys/dev/hyperv/if_hvn.c   Thu Nov 21 14:07:52 2019 +0000
+++ b/sys/dev/hyperv/if_hvn.c   Sun Nov 24 08:11:06 2019 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
                        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 @@
                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 @@
                        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 @@
            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,
diff -r a8e20936439b -r a1f3c6807fb7 sys/dev/hyperv/vmbus.c
--- a/sys/dev/hyperv/vmbus.c    Thu Nov 21 14:07:52 2019 +0000
+++ b/sys/dev/hyperv/vmbus.c    Sun Nov 24 08:11:06 2019 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/systm.h>
@@ -604,7 +604,7 @@
                        hyperv_intr();
                        splx(s);
                } else
-                       tsleep(wchan, PRIBIO, wchan, 1);
+                       tsleep(wchan, PRIBIO, wchan, mstohz(delays[i]));
        }
        if (status != HYPERCALL_STATUS_SUCCESS) {
                device_printf(sc->sc_dev,
@@ -666,7 +666,8 @@
                        hyperv_intr();
                        splx(s);
                } else
-                       tsleep(wchan, PRIBIO, wmsg ? wmsg : "hvwait", 1);
+                       tsleep(wchan, PRIBIO, wmsg ? wmsg : "hvwait",
+                           mstohz(1));
        }
 }
 



Home | Main Index | Thread Index | Old Index