From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 14:59:06 2011 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EDA8106564A; Tue, 20 Dec 2011 14:59:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 267928FC13; Tue, 20 Dec 2011 14:59:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA02678; Tue, 20 Dec 2011 16:59:03 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rd19j-000JQH-Ed; Tue, 20 Dec 2011 16:59:03 +0200 Message-ID: <4EF0A2B6.8050206@FreeBSD.org> Date: Tue, 20 Dec 2011 16:59:02 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Attilio Rao References: <4EF088C8.8090906@FreeBSD.org> In-Reply-To: X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-usb@FreeBSD.org Subject: Re: ukbd locking update X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 14:59:06 -0000 on 20/12/2011 16:00 Attilio Rao said the following: > 2011/12/20 Andriy Gapon : >> >> 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. > > That's right, however, if you plan to axe those because of the newbus > assumption I'd prefer you add a comment for every function you touch > saying that it needs to be Giant protected (in order to cope with them > once newbus is made MPSAFE). I put mtx_assert there. I think that that should be sufficiently self-documenting and self-protecting too. -- Andriy Gapon