Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Feb 2001 21:14:08 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.ORG>
To:        Chuck Paterson <cp@bsdi.com>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   RE: usb, clists, spltty, splbio
Message-ID:  <XFMail.010208211408.jhb@FreeBSD.org>
In-Reply-To: <200102090321.f193L6k00368@grendel.bsdi.com>

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

On 09-Feb-01 Chuck Paterson wrote:
> 
>       I have been mucking with making moused talk to a usb joystick.
> This all turned out pretty straight forward, all user land code in
> moused talking to the hid device. The problem is that the kernel
> crashes randomly, more often as the system get more loaded. A couple
> of times I got a panic in the clist code, but it really didn't
> show anything direct. Oh yah, this is with stable, not current.
> 
>       Reading through the code I found what looks like a problem.
> The hid, and other usb code use clists. The various usb code is
> protected by splusb which is a defined as splbio. The function
> b_to_q() and all the other clist code use spltty.
> 
> I changed the definition of spltty from
> 
> GENSPL(spltty,                |=,     tty_imask,                             
14)
> 
> to
> 
> GENSPL(spltty,                |=,     tty_imask | bio_imask,                 
14)
> 
> and the crashes appear to have gone away. I say appear, it has run
> longer now than it has before, but it hasn't been up much more than
> twice as long yet.
> 
>       I am not quite sure the best way to deal with this. The only
> idea I have thought of that I like at all is to create a splclist()
> which is the or of tty and bio and put that into the code that
> mucks with clists, perhaps just the allocation/free routines.

We have a similar problem with the slip and ppp devices, which have
run code under botth spltty and splnet.  The trick we use there is
to actually change the imasks by doing something along the lines of:

        net_mask |= tty_imask;
        tty_imask = net_imask;

So there is at least prior precedent for doing this sort of thing.

> Comments
> Chuck


-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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