From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 15:19:16 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 5B0721065672; Tue, 20 Dec 2011 15:19:16 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BACA18FC12; Tue, 20 Dec 2011 15:19:15 +0000 (UTC) Received: by faaf16 with SMTP id f16so5187823faa.13 for ; Tue, 20 Dec 2011 07:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tqdebGASBqbmTlcsav1om9zeCqRNOzGZXOfvzTe8kns=; b=h6xOhjKUBYmUDISk76FJe526JRn5WzKmBiWBP9dkTBq0Rz7SObAjxwfMBgV70aC4yZ Yv/ZSglMKu0m2xe7QmPDui6CQcNTQUx8UsCw3xz7ToM1OMIMJv4rLt9N2jzGKz1DREKV DHoHfpZqZmm0M2sk6quyvv08QPNDTsQkSPyNg= MIME-Version: 1.0 Received: by 10.181.12.43 with SMTP id en11mr5668689wid.6.1324394354475; Tue, 20 Dec 2011 07:19:14 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.18.130 with HTTP; Tue, 20 Dec 2011 07:19:14 -0800 (PST) In-Reply-To: <4EF0A2B6.8050206@FreeBSD.org> References: <4EF088C8.8090906@FreeBSD.org> <4EF0A2B6.8050206@FreeBSD.org> Date: Tue, 20 Dec 2011 16:19:14 +0100 X-Google-Sender-Auth: fbwzJp9gmJoDR6_aCntkCjE87b8 Message-ID: From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 15:19:16 -0000 2011/12/20 Andriy Gapon : > 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 thei= r 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. =C2=A0That's done either by the general newbus code or via >>> usbd_enum_lock() when the operations are executed in the USB explore th= read. >> >> 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. =C2=A0I think that that should be sufficiently > self-documenting and self-protecting too. Yes, that looks good. Attilio --=20 Peace can only be achieved by understanding - A. Einstein