Module Name:    src
Committed By:   riastradh
Date:           Tue Aug 27 14:01:35 UTC 2013

Modified Files:
        src/sys/kern: kern_rndq.c

Log Message:
Schedule wakeups asynchronously in rnd_extract_data.

Otherwise, rndsink_request takes rndsinks_lock and calls
rnd_extract_data, which synchronously calls rndsinks_distribute,
which takes rndsinks_lock -> boom.

This is a stop-gap on a stop-gap on a stop-gap; we really ought to
back out all of these stop-gaps, make bcm2835_rng call rnd_add_data
asynchronously to work around the original symptom, and design a real
solution when we have time to sort this mess out properly.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/kern_rndq.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.16 src/sys/kern/kern_rndq.c:1.17
--- src/sys/kern/kern_rndq.c:1.16	Mon Aug 26 23:41:24 2013
+++ src/sys/kern/kern_rndq.c	Tue Aug 27 14:01:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.16 2013/08/26 23:41:24 tls Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.17 2013/08/27 14:01:35 riastradh 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.16 2013/08/26 23:41:24 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.17 2013/08/27 14:01:35 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -1038,7 +1038,7 @@ rnd_extract_data(void *p, u_int32_t len,
 	mutex_spin_exit(&rndpool_mtx);
 
 	if (wake) {
-		rnd_wakeup_readers();
+		rnd_schedule_wakeup();
 	}
 
 	return retval;

Reply via email to