Date: Mon, 09 May 2005 14:45:46 -0600 (MDT) From: Warner Losh <imp@bsdimp.com> To: hselasky@c2i.net Cc: freebsd-usb@freebsd.org Subject: Re: usb/80829: possible panic when loading USB-modules Message-ID: <20050509.144546.74694206.imp@bsdimp.com> In-Reply-To: <200505092220.42970.hselasky@c2i.net> References: <200505091849.15420.hselasky@c2i.net> <20050509.110153.78761402.imp@bsdimp.com> <200505092220.42970.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
> I'm planning to use the stack method and have usbd_probe_and_attach() called > again from uhub_explore() via a call similar to usb_explore(). Leaving > devices after usbd_probe_and_attach() has returned, will _not_ work, except > for generic or specific USB drivers. It will not work for "ums", "ukbd" and > so on, because a device can have more than one configuration, and it is not > sure that the right configuration index is set when usbd_probe_and_attach() > returns after the generic probe. Have a look at this (almost finished): > > Implement a new state-variable "udev->probed" and a refcount in "usbd_port" to > limit the calling of "usbd_probe_and_attach()". > > Any comments? That can't work. The problem is that if there's no driver loaded, the device_t sticks around (and must stick around). When the driver is then loaded, we look at all the unattached devices again and at that point the memory that's reference has to be stable. That's why I made the change in the first place. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050509.144546.74694206.imp>