Re: Detaching USB stick crashes BETA4/BETA5

From: Alexandre \ <Alex.Kovalenko_at_verizon.net>
Date: Tue, 21 Sep 2004 21:26:31 -0400
On Tue, 2004-09-21 at 20:36, M. Warner Losh wrote:
> In message: <1095812538.2535.36.camel_at_RabbitsDen>
>             "Alexandre \"Sunny\" Kovalenko" <Alex.Kovalenko_at_verizon.net> writes:
> : On Tue, 2004-09-21 at 07:09, Lutz Bichler wrote:
> : > On Tuesday 21 September 2004 06:59, you wrote:
> : > > This may be my fault.  Any chance you can give me a traceback?
> : > 
> : > I would like to, but i cannot get a crash dump. Tried the kernel debugger 
> : > (option DDB) an got the following trace:
> : > 
> : > db> trace
> : > kobj_delete(c1e2ab80,c068c6a0,c1e28180,cc726c2c,c04862e2) at kobj_delete+0x14
> : > device_delete_child(c1ef6c80, c1e2ab80,c16v4200,c16c4200,0) at 
> : > device_delete_child+0xb1
> : > usb_disconnect_port(c1f21870,c1ef6c80,cc726c50,c1614bc0,c1ef6c80) at 
> : > usb_disconnect_port+0xd2
> : > uhub_detach(c1ef6c80,c1578874,c067dfc4,c1ef6c80,0) at uhub_detach+0x7e
> : > device_detach(c1ef6c80,c1e2ab80,c1ef6b00,cc726ca8,c04862e2) at 
> : > device_detach+0x6a
> : > device_delete_child(c15b4880,c1ef6c80,c15bda80,c15bda80,3) at 
> : > device_delete_child+0x3f
> : > usb_disconnect_port(c15b4430,c15b4880,10,c04dca9c,c15ca210) at 
> : > usb_disconnect_port+0xd2
> : > uhub_explore(c15b8900,c15d3140,cc726d10,c0482e48,c15d3140) at 
> : > uhub_explore+0x1be
> : > usb_discover(c15d3140,0,5c,c065d8d9,1770) at usb_discover+0x35
> : > usb_event:_thread(c15d3140,cc726d48,0,0,0) at usb_event_thread+0x88
> : > fork_exit(c0482dc0,c15d3140,cc726d48) at fork_exit+0x80
> : > fork_trampoline() at for_trampoline+0x8
> : > --- trap 0x1, eip = 0, esp = 0xcc726d7c, ebp = 0 ---
> : > db>
> : > 
> : > Regards
> : >  Lutz
> : > _______________________________________________
> : > freebsd-current_at_freebsd.org mailing list
> : > http://lists.freebsd.org/mailman/listinfo/freebsd-current
> : > To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
> : I was able to get crash dump in the situation that looks similar to one
> : above and posted my explorations to this list (see "Re: usb hub
> : disconnect crashes 5.3-BETA4 hard"). If you think they are relevant or
> : useful, let me know and I can resend it to you privately. I am running
> : -current though.
> 
> 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.
> 
> 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);
>  
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
I can confirm that with this patch system does not crash no matter how
many times I plug and unplug the hub with plenty of devices attached to
it. System in question is 6.0 current as of 9/18.

Thank you very much.
---
Alexandre "Sunny" Kovalenko.
Received on Tue Sep 21 2004 - 23:27:07 UTC

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