svn commit: r188273 - head/sys/dev/usb2/controller

Niclas Zeising niclas.zeising at gmail.com
Sat Feb 7 02:59:36 PST 2009


Andrew Thompson wrote:
> Author: thompsa
> Date: Sat Feb  7 06:27:16 2009
> New Revision: 188273
> URL: http://svn.freebsd.org/changeset/base/188273
> 
> Log:
>   Dont hold the lock over the controller init, we are still attaching.
> 
> Modified:
>   head/sys/dev/usb2/controller/ehci2.c
>   head/sys/dev/usb2/controller/ohci2.c
>   head/sys/dev/usb2/controller/uhci2.c
> 
> Modified: head/sys/dev/usb2/controller/ehci2.c
> ==============================================================================
> --- head/sys/dev/usb2/controller/ehci2.c	Sat Feb  7 05:41:24 2009	(r188272)
> +++ head/sys/dev/usb2/controller/ehci2.c	Sat Feb  7 06:27:16 2009	(r188273)
> @@ -223,8 +223,6 @@ ehci_init(ehci_softc_t *sc)
>  	uint16_t bit;
>  	usb2_error_t err = 0;
>  
> -	USB_BUS_LOCK(&sc->sc_bus);
> -
>  	DPRINTF("start\n");
>  
>  	usb2_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
> @@ -259,10 +257,12 @@ ehci_init(ehci_softc_t *sc)
>  	/* Reset the controller */
>  	DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev));
>  
> +	USB_BUS_LOCK(&sc->sc_bus);
>  	err = ehci_hc_reset(sc);
> +	USB_BUS_UNLOCK(&sc->sc_bus);
>  	if (err) {
>  		device_printf(sc->sc_bus.bdev, "reset timeout\n");
> -		goto done;
> +		return (error);
                 ^^^^^^^^^^^^^^^

This broke the build. I'm not familiar with the code, but might it be 
err you want to return since you set it a bit earlier, and it is of the 
correct type.
[SNIP the rest of the diff]

Regards!
//Niclas
--



More information about the svn-src-all mailing list