From owner-freebsd-usb@FreeBSD.ORG Thu May 12 16:39:08 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 0769E16A4CE for ; Thu, 12 May 2005 16:39:08 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9230543D58 for ; Thu, 12 May 2005 16:39:07 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j4CGcXca005436; Thu, 12 May 2005 10:38:34 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 12 May 2005 10:39:43 -0600 (MDT) Message-Id: <20050512.103943.115908855.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200505121755.32810.hselasky@c2i.net> References: <20050511.175830.58826830.imp@bsdimp.com> <200505121548.02651.hselasky@c2i.net> <200505121755.32810.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: usb@freebsd.org Subject: Re: Panic when removing Airprime PC5220 card (usb hub). 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: Thu, 12 May 2005 16:39:08 -0000 In message: <200505121755.32810.hselasky@c2i.net> Hans Petter Selasky writes: : On Thursday 12 May 2005 15:48, Hans Petter Selasky wrote: : > On Thursday 12 May 2005 01:58, M. Warner Losh wrote: : > > In message: <200505120058.51834.hselasky@c2i.net> : > > : > > Hans Petter Selasky writes: : > > : On Wednesday 11 May 2005 22:33, Warner Losh wrote: : : Maybe something like this is better, so that memory doesn't leak. : : usb_disconnect_port(struct usbd_port *up, device_ptr_t parent, : u_int8_t free_subdev) : { : ... : #ifdef __FreeBSD__ : config_detach(dev->subdevs[i], DETACH_FORCE, free_subdev); : #else : config_detach(dev->subdevs[i], DETACH_FORCE); : #endif : ... : } : : #define config_detach(dev, flag, free_subdev) \ : do { \ : free(device_get_ivars(dev), M_USB); \ : if(free_subdev) \ : device_delete_child(device_get_parent(dev), dev); \ : } while (0); Apart from ugly ifdef, that might have some merit. We don't necessarily want to delete devices unless the hardware goes away. Warner