summaryrefslogtreecommitdiffstats
path: root/sys/geom/eli/g_eli.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-01-28 20:29:12 +0000
committerpjd <pjd@FreeBSD.org>2007-01-28 20:29:12 +0000
commit4e4fa80cab65d1b2162ab8461440d54dcca85b19 (patch)
tree4b9be15c902e95ab07ddba46bf884932480a50e1 /sys/geom/eli/g_eli.c
parent16407416141612810a740ca0bebfc7025f09b5a6 (diff)
downloadFreeBSD-src-4e4fa80cab65d1b2162ab8461440d54dcca85b19.zip
FreeBSD-src-4e4fa80cab65d1b2162ab8461440d54dcca85b19.tar.gz
It is possible that GEOM taste provider before SMP is started.
We can't bind to a CPU which is not yet on-line, so add code that wait for CPUs to go on-line before binding to them. Reported by: Alin-Adrian Anton <aanton@spintech.ro> MFC after: 2 weeks
Diffstat (limited to 'sys/geom/eli/g_eli.c')
-rw-r--r--sys/geom/eli/g_eli.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index d4b85cd..0e5b531 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -324,6 +324,13 @@ g_eli_worker(void *arg)
wr = arg;
sc = wr->w_softc;
+#ifdef SMP
+ /* Before sched_bind() to a CPU, wait for all CPUs to go on-line. */
+ if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0) {
+ while (!smp_started)
+ tsleep(wr, 0, "geli:smp", hz / 4);
+ }
+#endif
mtx_lock_spin(&sched_lock);
sched_prio(curthread, PRIBIO);
if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0)
OpenPOWER on IntegriCloud