Re: Detaching USB stick crashes BETA4/BETA5

From: Vladimir Grebenschikov <vova_at_fbsd.ru>
Date: Fri, 24 Sep 2004 09:36:12 +0400
В вт, 21/09/2004 в 18:36 -0600, M. Warner Losh пишет:

> Ian Dowse also is having problems in this area.  He suggested the
> following patch to me.  I have some concerns about the patch, but they
> are theoretical (what does it mean when a parent is detached, but all
> its children are attached?), but given the current state of the newbus
> code it will fix the problem for you.

Yes, it fix my problem with usb unplug too on recent CURRENT.
Please commit.

> Warner
> 
> Index: usb_port.h
> ===================================================================
> RCS file: /dump/FreeBSD-CVS/src/sys/dev/usb/usb_port.h,v
> retrieving revision 1.67
> diff -u -r1.67 usb_port.h
> --- usb_port.h	15 Aug 2004 23:39:18 -0000	1.67
> +++ usb_port.h	21 Sep 2004 23:46:27 -0000
> _at__at_ -422,6 +422,7 _at__at_
>  #define config_detach(dev, flag) \
>  	do { \
>  		free(device_get_ivars(dev), M_USB); \
> +		device_detach(dev); \
>  		device_delete_child(device_get_parent(dev), dev); \
>  	} while (0);
>  

-- 
Vladimir B. Grebenchikov
vova_at_fbsd.ru
Received on Fri Sep 24 2004 - 03:36:29 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:13 UTC