msleep() on recursivly locked mutexes

John Baldwin jhb at freebsd.org
Mon Apr 30 21:00:40 UTC 2007


On Friday 27 April 2007 02:32:20 pm Hans Petter Selasky wrote:
> > > P0 unlock(1);
> > > P0 unlock(2);
> >
> > this looks "interesting".
> > Can you give a more concrete example of this?
> > what work is done in the upcall? WHo is upcalling to who?
> 
> For example an USB device driver might be up-calling to the USB host 
> controller driver. Down call is when the transfer finishes.

I think in this case you don't want to keep the periph locked while you ask 
the controller to process requests.  Instead, the periph drivers should queue 
requests to the controller and receive replies, but they should be considered 
as two independent objects.  For example, network drivers drop their lock 
when passing a packet (request) up the stack.

-- 
John Baldwin


More information about the freebsd-arch mailing list