From owner-freebsd-usb@FreeBSD.ORG Mon May 9 20:47:12 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60D9D16A4EB for ; Mon, 9 May 2005 20:47:12 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6F1143D6E for ; Mon, 9 May 2005 20:47:11 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j49KjkuH056175; Mon, 9 May 2005 14:45:46 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 09 May 2005 14:45:46 -0600 (MDT) Message-Id: <20050509.144546.74694206.imp@bsdimp.com> To: hselasky@c2i.net From: Warner Losh 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> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-usb@freebsd.org Subject: Re: usb/80829: possible panic when loading USB-modules X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2005 20:47:12 -0000 > 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