Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci initialise sc_mtx slightly earlier, before it is...



details:   https://anonhg.NetBSD.org/src/rev/e61b0397e1de
branches:  trunk
changeset: 338025:e61b0397e1de
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat May 09 08:08:50 2015 +0000

description:
initialise sc_mtx slightly earlier, before it is used on systems with rng.

fixes problem reported by msaitoh@.

diffstat:

 sys/dev/pci/hifn7751.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 43356e3a54aa -r e61b0397e1de sys/dev/pci/hifn7751.c
--- a/sys/dev/pci/hifn7751.c    Sat May 09 06:15:42 2015 +0000
+++ b/sys/dev/pci/hifn7751.c    Sat May 09 08:08:50 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hifn7751.c,v 1.58 2015/04/27 17:38:01 christos Exp $   */
+/*     $NetBSD: hifn7751.c,v 1.59 2015/05/09 08:08:50 mrg Exp $        */
 /*     $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */
 /*     $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $  */
 
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.58 2015/04/27 17:38:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.59 2015/05/09 08:08:50 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -433,13 +433,13 @@
            sc->sc_dmamap->dm_mapsize,
            BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
+       mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_VM);
+
        if (sc->sc_flags & (HIFN_HAS_PUBLIC | HIFN_HAS_RNG)) {
                hifn_init_pubrng(sc);
                sc->sc_rng_need = RND_POOLBITS / NBBY;
        }
 
-       mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_VM);
-
 #ifdef __OpenBSD__
        timeout_set(&sc->sc_tickto, hifn_tick, sc);
        timeout_add(&sc->sc_tickto, hz);



Home | Main Index | Thread Index | Old Index