Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jul 1996 23:55:38 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        hackers@freebsd.org
Subject:   Odd hang in device driver...
Message-ID:  <199607091425.XAA16107@genesis.atrad.adelaide.edu.au>

next in thread | raw e-mail | index | archive | help

Howdy people; I know I unsubscribed, but I've tripped over a curly one
and some sage advice would be a lifesaver...

I'm seeing a 'Panic: double fault' hang that has me wondering about
the save size of auto data on the kernel stack.  I have a function I'll
call 'fooread()' - it's a device driver read function.

Now, because I'm a loser and haven't had time to investigate uiomove
properly, and because my interrupt handler uses a ringbuffer, I copy
data from the ringbuffer to a temporary buffer, and then uiomove() it 
out of there in the case of a buffer wrap.

Thus, the scratch buffer needs to be the same size as the largest read the
driver will allow - in this case, the same size as the ringbuffer.

To handle some serious application latency problems (not easily curable 8( )
I recently upped the receive buffer from 1K to 4K, and have subsequently
started seeing these double-fault hangs.  What has me wondering about 
the size of aut data issue is that the entry for the function in
question is at 0xf01c6d64, and eip for the double fault is 0xf01c6d6d.

I'm not sure of gcc's function preamble overhead, but I suspect that it's 
probably more than 10 bytes, and this is where the advice would be 
handy.  The first code in the function is the traditional :

    unit = minor(dev);

which appears to work for all other devices.

And as an aside which would help me avoid the double copy altogether, is 
it fair to say that :

	uiomove(buf, a, uio);
	uiomove(buf + a, b, uio);

would have the same effect as

	uiomove(buf, a + b, uio);

ie. is it possible to call uiomove more than once in a read/write function?

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 0411-222-496       [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] Collector of old Unix hardware.      "Where are your PEZ?" The Tick  [[



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