Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jul 1997 19:06:26 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-sys@FreeBSD.ORG, msmith@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/i386/isa isa.c
Message-ID:  <199707280936.TAA06166@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199707280919.TAA10322@godzilla.zeta.org.au> from Bruce Evans at "Jul 28, 97 07:19:18 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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 <syssgm@dtir.qld.gov.au>
> 
> 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  [[



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