Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Add very, very temporary and ugly work around for my...



details:   https://anonhg.NetBSD.org/src/rev/e65f72d08828
branches:  trunk
changeset: 771417:e65f72d08828
user:      tls <tls%NetBSD.org@localhost>
date:      Sun Nov 20 00:45:15 2011 +0000

description:
Add very, very temporary and ugly work around for my braino about detaching bad devices.  Will fix as soon as I have more time with the hardware where I can reproduce this.

diffstat:

 sys/dev/rnd.c |  19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (48 lines):

diff -r 67d89e4826de -r e65f72d08828 sys/dev/rnd.c
--- a/sys/dev/rnd.c     Sun Nov 20 00:28:51 2011 +0000
+++ b/sys/dev/rnd.c     Sun Nov 20 00:45:15 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rnd.c,v 1.84 2011/11/20 00:28:51 tls Exp $     */
+/*     $NetBSD: rnd.c,v 1.85 2011/11/20 00:45:15 tls Exp $     */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.84 2011/11/20 00:28:51 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.85 2011/11/20 00:45:15 tls Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -52,6 +52,7 @@
 #include <sys/kauth.h>
 #include <sys/once.h>
 #include <sys/rngtest.h>
+#include <sys/cpu.h>   /* XXX temporary, see rnd_detach_source */
 
 #if defined(__HAVE_CPU_COUNTER) && !defined(_RUMPKERNEL) /* XXX: bad pooka */
 #include <machine/cpu_counter.h>
@@ -968,13 +969,15 @@
 
        mutex_spin_exit(&rnd_mtx);
 
-       if (source->state) {
-               rnd_sample_free(source->state);
-               source->state = NULL;
-       }
+       if (!cpu_softintr_p()) {        /* XXX XXX very temporary "fix" */
+               if (source->state) {
+                       rnd_sample_free(source->state);
+                       source->state = NULL;
+               }
 
-       if (source->test) {
-               kmem_free(source->test, sizeof(rngtest_t));
+               if (source->test) {
+                       kmem_free(source->test, sizeof(rngtest_t));
+               }
        }
 
 #ifdef RND_VERBOSE



Home | Main Index | Thread Index | Old Index