Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Dec 2011 17:42:23 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: ukbd locking update
Message-ID:  <201112201742.23998.hselasky@c2i.net>
In-Reply-To: <4EF088C8.8090906@FreeBSD.org>
References:  <4EF088C8.8090906@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 20 December 2011 14:08:24 Andriy Gapon wrote:
> I completing a patch that changes some locking in ukbd to account for
> SCHEDULER_STOPPED and for other realities of the code.
> 
> As a preview I would like to share couple of observations that had their
> effect on the patch.
> 
> 1. Acquiring Giant in device_attach, _detach in similar newbus method
> implementations should be redundant because those are already executed with
> Giant held.  That's done either by the general newbus code or via
> usbd_enum_lock() when the operations are executed in the USB explore
> thread.
> 
> 2. As discussed before:
> if (!mutex_owned(&Giant))
> 	mutex_lock(&Giant)
> this pattern does not make sense, because the Giant is recursive and can be
> simply acquired without any check.
> 
> Do you agree?

Yes!

--HPS



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