From owner-freebsd-usb@FreeBSD.ORG Mon Aug 13 18:40:09 2012 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 950F3106566B for ; Mon, 13 Aug 2012 18:40:09 +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 80C418FC12 for ; Mon, 13 Aug 2012 18:40:09 +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 q7DIe9FE075153 for ; Mon, 13 Aug 2012 18:40:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7DIe9lG075152; Mon, 13 Aug 2012 18:40:09 GMT (envelope-from gnats) Date: Mon, 13 Aug 2012 18:40:09 GMT Message-Id: <201208131840.q7DIe9lG075152@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: usb/170606: 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: Mon, 13 Aug 2012 18:40:09 -0000 The following reply was made to PR usb/170606; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: usb/170606: commit references a PR Date: Mon, 13 Aug 2012 18:34:16 +0000 (UTC) Author: hselasky Date: Mon Aug 13 18:34:04 2012 New Revision: 239240 URL: http://svn.freebsd.org/changeset/base/239240 Log: Fix for missing locks due to recent change. PR: usb/170606 MFC after: 2 weeks Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Aug 13 18:10:52 2012 (r239239) +++ head/sys/dev/usb/usb_device.c Mon Aug 13 18:34:04 2012 (r239240) @@ -2777,8 +2777,15 @@ usbd_set_endpoint_mode(struct usb_device uint8_t ep_mode) { usb_error_t error; + uint8_t do_unlock; - sx_assert(&udev->enum_sx, SA_LOCKED); + /* automatic locking */ + if (usbd_enum_is_locked(udev)) { + do_unlock = 0; + } else { + do_unlock = 1; + usbd_enum_lock(udev); + } if (udev->bus->methods->set_endpoint_mode != NULL) { error = (udev->bus->methods->set_endpoint_mode) ( @@ -2792,6 +2799,9 @@ usbd_set_endpoint_mode(struct usb_device /* only set new mode regardless of error */ ep->ep_mode = ep_mode; + if (do_unlock) + usbd_enum_unlock(udev); + return (error); } _______________________________________________ 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"