Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2001 20:50:53 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Wilko Bulte <wkb@freebie.xs4all.nl>, Garrett Wollman <wollman@khavrinen.lcs.mit.edu>, <current@FreeBSD.ORG>
Subject:   Re: Seen this lock order reversal?
Message-ID:  <20010925203657.Q29474-100000@delplex.bde.org>
In-Reply-To: <XFMail.010924123332.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 24 Sep 2001, John Baldwin wrote:

> Hmm, that first one is in sysbeep() (the clk one)  Ah!
>
>         if (!beeping) {
>                 /* enable counter2 output to speaker */
>                 if (pitch) outb(IO_PPI, inb(IO_PPI) | 3);
>                 beeping = period;
>                 timeout(sysbeepstop, (void *)NULL, period);
>         }
>
> This is the problem code.  Hmmm.  The i386 code seems b0rked.  It doesn't have
> enough locks!  Eck.  hmm, the pc98 code doesn't even _use_ the mutex but still
> depends on disable/enable intr.  Eek.  I'll work at this later on today.

Better yet, even the i386 code doesn't even use disable/enable_intr() or
splhigh/splx()() in sysbeepstop().  However, since nothing much accesses
the PPI register, I think there is only an unimportant race between
sysbeep() and sysbeepstop().

There are some more interesting races in clock.c.  E.g., rtcin() is locked
by splhigh(), so calling it from the fast interrupt handler rtcintr() would
be invalid even if splhigh() were not a no-op.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010925203657.Q29474-100000>