From owner-freebsd-usb@FreeBSD.ORG Mon May 9 21:35:04 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 DDACF16A4EA for ; Mon, 9 May 2005 21:35:04 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F28A43D6D for ; Mon, 9 May 2005 21:35:04 +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 j49LWV5P056591; Mon, 9 May 2005 15:32:31 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 09 May 2005 15:32:31 -0600 (MDT) Message-Id: <20050509.153231.41689623.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 21:35:05 -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? I see why you are doing the reference count... I also see some of the problems involved. The main reason that I went from the stack method to the other method was so that the driver_added stuff would still work. That's the goal. Part of the problem is that the NetBSD device model ill fits newbus, for reasons that you're discovering... Warner