Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Initialize the rnd softint explicitly via a function lat...
details: https://anonhg.NetBSD.org/src/rev/fe3cc5228099
branches: trunk
changeset: 787501:fe3cc5228099
user: christos <christos%NetBSD.org@localhost>
date: Thu Jun 20 23:21:41 2013 +0000
description:
Initialize the rnd softint explicitly via a function late in main. Avoids
LOCKDEBUG panic since softint_establish() was called via wdcintr -> wddone
from an interrupt context and tried to acquire a non-spin mutex.
diffstat:
sys/kern/init_main.c | 6 ++++--
sys/kern/kern_rndq.c | 18 ++++++++----------
sys/sys/rnd.h | 3 ++-
3 files changed, 14 insertions(+), 13 deletions(-)
diffs (96 lines):
diff -r c921491ba2d4 -r fe3cc5228099 sys/kern/init_main.c
--- a/sys/kern/init_main.c Thu Jun 20 20:54:52 2013 +0000
+++ b/sys/kern/init_main.c Thu Jun 20 23:21:41 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.449 2013/06/05 19:01:26 christos Exp $ */
+/* $NetBSD: init_main.c,v 1.450 2013/06/20 23:21:41 christos Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.449 2013/06/05 19:01:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.450 2013/06/20 23:21:41 christos Exp $");
#include "opt_ddb.h"
#include "opt_ipsec.h"
@@ -565,6 +565,8 @@
if_attachdomain();
splx(s);
+ rnd_init_softint();
+
#ifdef GPROF
/* Initialize kernel profiling. */
kmstartup();
diff -r c921491ba2d4 -r fe3cc5228099 sys/kern/kern_rndq.c
--- a/sys/kern/kern_rndq.c Thu Jun 20 20:54:52 2013 +0000
+++ b/sys/kern/kern_rndq.c Thu Jun 20 23:21:41 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $ */
+/* $NetBSD: kern_rndq.c,v 1.13 2013/06/20 23:21:41 christos Exp $ */
/*-
* Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.13 2013/06/20 23:21:41 christos Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -174,6 +174,12 @@
rndsave_t *boot_rsp;
+void
+rnd_init_softint(void) {
+ rnd_process = softint_establish(SOFTINT_SERIAL|SOFTINT_MPSAFE,
+ rnd_intr, NULL);
+}
+
/*
* Generate a 32-bit counter. This should be more machine dependent,
* using cycle counters and the like when possible.
@@ -207,20 +213,12 @@
kpreempt_enable();
}
-/*
- * XXX repulsive: we can't initialize our softints in rnd_init
- * XXX (too early) so we wrap the points where we'd schedule them, thus.
- */
static inline void
rnd_schedule_process(void)
{
if (__predict_true(rnd_process)) {
rnd_schedule_softint(rnd_process);
return;
- }
- if (!cold) {
- rnd_process = softint_establish(SOFTINT_SERIAL|SOFTINT_MPSAFE,
- rnd_intr, NULL);
}
rnd_process_events();
}
diff -r c921491ba2d4 -r fe3cc5228099 sys/sys/rnd.h
--- a/sys/sys/rnd.h Thu Jun 20 20:54:52 2013 +0000
+++ b/sys/sys/rnd.h Thu Jun 20 23:21:41 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rnd.h,v 1.36 2013/06/13 00:55:01 tls Exp $ */
+/* $NetBSD: rnd.h,v 1.37 2013/06/20 23:21:42 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -176,6 +176,7 @@
void rndpool_add_data(rndpool_t *, void *, uint32_t, uint32_t);
uint32_t rndpool_extract_data(rndpool_t *, void *, uint32_t, uint32_t);
void rnd_init(void);
+void rnd_init_softint(void);
void _rnd_add_uint32(krndsource_t *, uint32_t);
void rnd_add_data(krndsource_t *, const void *const, uint32_t,
uint32_t);
Home |
Main Index |
Thread Index |
Old Index