summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-10-20 03:32:33 +0000
committerjhb <jhb@FreeBSD.org>2001-10-20 03:32:33 +0000
commit891c34698a4faa7efcd9ce88df5ac94ddb4c2d62 (patch)
treecccb03262f8b70332a6a490fe8b029e71e436d81 /sys/isa
parent6d85fccce7fdcfe3bf0e0f761bbee8af401e2760 (diff)
downloadFreeBSD-src-891c34698a4faa7efcd9ce88df5ac94ddb4c2d62.zip
FreeBSD-src-891c34698a4faa7efcd9ce88df5ac94ddb4c2d62.tar.gz
- Make the sio_inited handling more properly MP safe.
- If we are booting with a serial console, then pass the MTX_QUIET flag to mtx_init of the sio lock as otherwise KTR_VERBOSE simply doesn't work.
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/sio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index badf07d..9f86bc8 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -778,8 +778,12 @@ sioprobe(dev, xrid)
com->bst = rman_get_bustag(port);
com->bsh = rman_get_bushandle(port);
- if (atomic_cmpset_int(&sio_inited, 0, 1))
- mtx_init(&sio_lock, driver_name, MTX_SPIN);
+ while (sio_inited != 2)
+ if (atomic_cmpset_int(&sio_inited, 0, 1)) {
+ mtx_init(&sio_lock, driver_name, (comconsole != -1) ?
+ MTX_SPIN | MTX_QUIET : MTX_SPIN);
+ atomic_store_rel_int(&sio_inited, 2);
+ }
#if 0
/*
OpenPOWER on IntegriCloud