Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jul 2004 23:18:20 +0200
From:      Bernd Walter <ticso@cicely12.cicely.de>
To:        Lukas Ertl <l.ertl@univie.ac.at>
Cc:        arch@freebsd.org
Subject:   Re: USB locking
Message-ID:  <20040709211819.GC35892@cicely12.cicely.de>
In-Reply-To: <20040709170834.U581@korben.in.tern>
References:  <20040709170834.U581@korben.in.tern>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 09, 2004 at 05:10:55PM +0200, Lukas Ertl wrote:
> Hello,
> 
> I've prepared a patch that adds some basic locking primitives to parts of 
> the USB stack (usb.c, uhci.c, ehci.c).  Mainly, I've added some mutexes 
> and applied them instead of calls to spl*, wrapped into #ifdef's to stay 
> somewhat compatible with NetBSD.  I'd be happy if I could get some review.
> 
> <http://people.freebsd.org/~le/usb.diff>;

Just replacing spl* with locks is not enough to protect code.
spls were only required to protect from interrupts, but whithout GIANT
we need to protect from multiple userland calls as well.

One point that I noticed was that you call usb_transfer_complete with a
lock held - this function will run the upcall function of the xfer
issuer, which is code you don't know anything about.

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd@bwct.de                                  info@bwct.de



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