Date: Thu, 05 May 2005 16:13:16 -0600 (MDT) From: Warner Losh <imp@bsdimp.com> To: julian@elischer.org Cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics Message-ID: <20050505.161316.39243994.imp@bsdimp.com> In-Reply-To: <427A9862.1020100@elischer.org> References: <427A8EF3.70003@elischer.org> <20050505.153302.71182158.imp@bsdimp.com> <427A9862.1020100@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
From: Julian Elischer <julian@elischer.org> > do you remember the full extent of your fix? > I'm just learning about the bus/device stuff as I go.. > the trick is bringing forward as much of the USB code withoug bringing > forward a bunch of subr_bus etc. as well. I'm sure that cvs does: revision 1.63 date: 2004/09/09 20:43:49; author: imp; state: Exp; lines: +2 -34 We don't need a uhub_child_detached() routine now that we don't detach device_t instances when no driver attaches. They are left around, and we need to remember them. # The usbd_device_handle->subdevs[] array likely is completely bogus # at this point, but one change at a time, since its removal will need # to have similar code replace it extracted from newbus. Part of the patch submitted by Peter Pentchev after an excellent analysis of the underlying problems. MFC After: 1 week which lead me to the following from CVSROOT/commitligs/sys.20040922.gz: imp 2004-08-14 22:10:26 UTC FreeBSD src repository Modified files: sys/dev/usb uhub.c usb_port.h usb_subr.c Log: Next step in making usb more newbus: o reprobe children when a new driver is added to uhub o fix the usbd_probe_and_attach to set the ivars to a malloc'd area, as well as freeing the ivars on child destruction. o Don't delete children that don't attach. Evidentally, the need to do this is a common misconception. o minor formatting foo that may violate style(9) at the moment, but keeps the diffs against my p4 tree smaller. This does not solve the ugen gobbling things up problem, but the fixes I have for that expose bugs in other parts of the tree... Revision Changes Path 1.61 +14 -26 src/sys/dev/usb/uhub.c 1.66 +5 -1 src/sys/dev/usb/usb_port.h 1.68 +31 -37 src/sys/dev/usb/usb_subr.c imp 2004-09-09 20:43:49 UTC FreeBSD src repository Modified files: sys/dev/usb uhub.c Log: We don't need a uhub_child_detached() routine now that we don't detach device_t instances when no driver attaches. They are left around, and we need to remember them. # The usbd_device_handle->subdevs[] array likely is completely bogus # at this point, but one change at a time, since its removal will need # to have similar code replace it extracted from newbus. Part of the patch submitted by Peter Pentchev after an excellent analysis of the underlying problems. MFC After: 1 week Revision Changes Path 1.63 +2 -34 src/sys/dev/usb/uhub.c imp 2004-09-09 20:47:28 UTC FreeBSD src repository Modified files: sys/dev/usb usb_subr.c Log: Add comments about why we're freeing subdevs (which is completely redundant at this point and should be retired). Don't free subdevs if we don't attach any devices. This was leaving stale device_t's around. Don't touch the device if it isn't attached since the name isn't meaningful then. Switch from strncpy (properly used) to strlcpy. From a patch submitted by Peter Pentchev Revision Changes Path 1.70 +11 -8 src/sys/dev/usb/usb_subr.c I can't recall of there were other commits to follow. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050505.161316.39243994.imp>