From owner-cvs-sys Mon Jul 28 02:36:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA20847 for cvs-sys-outgoing; Mon, 28 Jul 1997 02:36:47 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA20838; Mon, 28 Jul 1997 02:36:29 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id TAA06166; Mon, 28 Jul 1997 19:06:26 +0930 (CST) From: Michael Smith Message-Id: <199707280936.TAA06166@genesis.atrad.adelaide.edu.au> Subject: Re: cvs commit: src/sys/i386/isa isa.c In-Reply-To: <199707280919.TAA10322@godzilla.zeta.org.au> from Bruce Evans at "Jul 28, 97 07:19:18 pm" To: bde@zeta.org.au (Bruce Evans) Date: Mon, 28 Jul 1997 19:06:26 +0930 (CST) Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-sys@FreeBSD.ORG, msmith@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Bruce Evans stands accused of saying: > >msmith 1997/07/28 00:49:41 PDT > > > > Modified files: > > sys/i386/isa isa.c > > Log: > > Use disable_intr() / read/write_eflags() to ensure that interrupt > > handlers don't skew the results of isa_dmastatus. The function can be > > safely called with interrupts disabled. > > > > Submitted by: Stephen McKay > > Erm, it already used splhigh() to ensure this. Does splhigh() prevent fast interrupt handlers from being called? The issue is not "not having stuff done while we run" but "any stuff at all happening while we run". > Rule 1: No function can be called safely with CPU interrupts disabled. Can you explain "why" in simple terms? > splhigh() wouldn't be enough if isa_dmastatus() were called from a > fast interrupt handler, but this shouldn't happen - see rule 1 :-). > It would be particularly unsafe to call it, since the fast interrupt > might be interrupting isa_dmastart() or other programming of the DMA > registers that should be atomic. Fair enough. I posit that these other accesses to the DMA registers should be similarly interrupt-immune. > isa_dmastart() doesn't even use splhigh(). This seems to be more > broken than I thought :-(. Concurrent calls from interrupt handlers > can happen because interrupt handlers that used DMA don't all run > at the same ipl. Only ipl = splhigh() would be common, and that > would be too high. See above. > Bruce -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[