Subject: Re: DS3100 ethernet spl problem fixed
To: Arne H. Juul <>
From: Jason Thorpe <>
List: port-pmax
Date: 12/30/1995 18:04:55
On Sun, 31 Dec 1995 01:45:14 +0100 
 "Arne H. Juul" <> wrote:

 > Obviously splimp() must block network interrupts, and because of slip/ppp
 > also network interrupts.  Blocking soft interrupts (softclock and softnet)
 > makes sense to me too - those are after all soft (low-pri).  However,
 > I don't understand why splimp() needs to block 'disk-type' (bio) interrupts
 > as well - "for ccd"?  I've looked a bit at the ccd driver and couldn't
 > find anything there.  Charles, could you please explain this a bit further?

The ccd uses malloc() and free() to deal with component buffers:

 #define getccdbuf()             \
        ((struct ccdbuf *)malloc(sizeof(struct ccdbuf), M_DEVBUF, M_WAITOK))
 #define putccdbuf(cbp)          \
        free((caddr_t)(cbp), M_DEVBUF)

malloc() amnd free() operate at splimp, and thus it needs to block bio 
interrupts so that putccdbuf() isn't called during another free() or 
malloc() operation.  It's reasonable to assume that other drivers may 
call malloc() and/or free() at interrupt time.

Once upon a time, the i386 didn't block bio at splimp(), and it caused 
Bad Things to happen during my nightly backup of my ccd...

Hope that clarifies things a bit.

 > If we really need to block tty, net, bio and softclock there's not much
 > left (hardclock of course).

That's the way it is on the m68k ports, too.

Jason R. Thorpe                             
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939