From owner-freebsd-usb@FreeBSD.ORG Tue Dec 20 14:25:54 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 72BEE106564A for ; Tue, 20 Dec 2011 14:25:54 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 0B83A8FC15 for ; Tue, 20 Dec 2011 14:25:53 +0000 (UTC) Received: by wgbdr11 with SMTP id dr11so12537122wgb.31 for ; Tue, 20 Dec 2011 06:25:53 -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=WzZ8UZEsPNL2y3dL6ipucPAlaiKfVn6+bPyEa7fTrZg=; b=fVBBwEZ3eh7HqkuooLXPyK6gYCOUeWs6IQXcj1ihRKNce5Zy/Ey7PDwbVoOG1v5vjT nuH2Cjq0JbKzziegCwkIb2qPcmp4yiWZFk9mOqDnfqW1PSnADJeTODsFIknX/h248bau 0JxlhtrO4pOJfGuBgaqbw059lRtQpVav3Whig= MIME-Version: 1.0 Received: by 10.227.200.206 with SMTP id ex14mr2188715wbb.11.1324389604621; Tue, 20 Dec 2011 06:00:04 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.18.130 with HTTP; Tue, 20 Dec 2011 06:00:04 -0800 (PST) In-Reply-To: <4EF088C8.8090906@FreeBSD.org> References: <4EF088C8.8090906@FreeBSD.org> Date: Tue, 20 Dec 2011 15:00:04 +0100 X-Google-Sender-Auth: XZ0Di2mgYVE60oLjD1BkrRdRi7A 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 14:25:54 -0000 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 wi= th > 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 thre= ad. 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). Attilio --=20 Peace can only be achieved by understanding - A. Einstein