From owner-freebsd-usb@FreeBSD.ORG Wed Dec 21 08:50:11 2011 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE79C106566B for ; Wed, 21 Dec 2011 08:50:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AE24E8FC0A for ; Wed, 21 Dec 2011 08:50:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBL8oBhc035576 for ; Wed, 21 Dec 2011 08:50:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBL8oBFB035575; Wed, 21 Dec 2011 08:50:11 GMT (envelope-from gnats) Date: Wed, 21 Dec 2011 08:50:11 GMT Message-Id: <201112210850.pBL8oBFB035575@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/163091: commit references a PR X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 08:50:11 -0000 The following reply was made to PR kern/163091; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/163091: commit references a PR Date: Wed, 21 Dec 2011 08:46:17 +0000 (UTC) Author: hselasky Date: Wed Dec 21 08:46:08 2011 New Revision: 228758 URL: http://svn.freebsd.org/changeset/base/228758 Log: Fix for race against user-space applications trying to change the configuration on USB HUBs. PR: kern/163091 MFC after: 1 week Modified: head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Wed Dec 21 02:45:51 2011 (r228757) +++ head/sys/dev/usb/usb_hub.c Wed Dec 21 08:46:08 2011 (r228758) @@ -707,6 +707,13 @@ uhub_explore(struct usb_device *udev) DPRINTF("Device is suspended!\n"); return (0); } + + /* + * Make sure we don't race against user-space applications + * like LibUSB: + */ + usbd_enum_lock(udev); + for (x = 0; x != hub->nports; x++) { up = hub->ports + x; portno = x + 1; @@ -784,6 +791,8 @@ uhub_explore(struct usb_device *udev) up->restartcnt = 0; } + usbd_enum_unlock(udev); + /* initial status checked */ sc->sc_flags |= UHUB_FLAG_DID_EXPLORE; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"