From owner-freebsd-current Tue Sep 25 3:51:32 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 3485C37B410; Tue, 25 Sep 2001 03:51:28 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA29453; Tue, 25 Sep 2001 20:51:25 +1000 Date: Tue, 25 Sep 2001 20:50:53 +1000 (EST) From: Bruce Evans X-X-Sender: To: John Baldwin Cc: Wilko Bulte , Garrett Wollman , Subject: Re: Seen this lock order reversal? In-Reply-To: Message-ID: <20010925203657.Q29474-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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