summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2005-06-04 23:24:50 +0000
committermarius <marius@FreeBSD.org>2005-06-04 23:24:50 +0000
commitc74fc16e2d53283bd07cca184cb14f3756e96cd6 (patch)
tree0fdba4f2b7230bd94e29e31cbe9e619f8f262091 /sys/sparc64
parent9230b25dd78459f5e14760d924dafc0ab3c1a555 (diff)
downloadFreeBSD-src-c74fc16e2d53283bd07cca184cb14f3756e96cd6.zip
FreeBSD-src-c74fc16e2d53283bd07cca184cb14f3756e96cd6.tar.gz
After some input from bde@ and rereading the datasheet use a MTX_SPIN
mutex instead of a MTX_DEF one in order to defer preemption while reading the date and time registers. If we don't manage to read them within the time slot where we are guaranteed that no updates occur we might actually read them during an update in which case the output is undefined.
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/rtc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sparc64/sparc64/rtc.c b/sys/sparc64/sparc64/rtc.c
index 234d1b7..be8e009 100644
--- a/sys/sparc64/sparc64/rtc.c
+++ b/sys/sparc64/sparc64/rtc.c
@@ -149,7 +149,7 @@ rtc_attach(device_t dev)
sc = device_get_softc(dev);
bzero(sc, sizeof(struct mc146818_softc));
- mtx_init(&sc->sc_mtx, "rtc_mtx", NULL, MTX_DEF);
+ mtx_init(&sc->sc_mtx, "rtc_mtx", NULL, MTX_SPIN);
if (strcmp(device_get_name(device_get_parent(dev)), "isa") == 0)
rtype = SYS_RES_IOPORT;
OpenPOWER on IntegriCloud