Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jan 2012 09:20:10 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-usb@FreeBSD.org
Subject:   Re: kern/163091: commit references a PR
Message-ID:  <201201030920.q039KAaS067832@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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: Tue,  3 Jan 2012 09:18:00 +0000 (UTC)

 Author: hselasky
 Date: Tue Jan  3 09:17:50 2012
 New Revision: 229371
 URL: http://svn.freebsd.org/changeset/base/229371
 
 Log:
   MFC r228758:
    - Fix for race against user-space applications trying to change the
    configuration on USB HUBs.
   
   PR:     kern/163091
 
 Modified:
   stable/8/sys/dev/usb/usb_hub.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/conf/ldscript.mips.octeon1.32   (props changed)
   stable/8/sys/conf/ldscript.mips.octeon1.64   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
 
 Modified: stable/8/sys/dev/usb/usb_hub.c
 ==============================================================================
 --- stable/8/sys/dev/usb/usb_hub.c	Tue Jan  3 09:15:54 2012	(r229370)
 +++ stable/8/sys/dev/usb/usb_hub.c	Tue Jan  3 09:17:50 2012	(r229371)
 @@ -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"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201030920.q039KAaS067832>