Date: Thu, 11 Apr 2002 13:13:25 +0200 (CEST) From: Nick Hibma <n_hibma@van-laarhoven.org> To: Thomas Quinot <thomas@cuivre.fr.eu.org> Cc: "freebsd-scsi@freebsd.org" <freebsd-scsi@freebsd.org> Subject: Re: xpt_bus_deregister Message-ID: <20020411124923.F31033-100000@heather.van-laarhoven.org> In-Reply-To: <20020409235020.A2397@melusine.cuivre.fr.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Don't you have a loop in there now? The AC_LOST_DEVICE event is generated by the SIM on detachment of a device, so you don't have to wait for the event to be delivered to you. In your SIM you should not create a async andler for async events for the devices attached to your SIM. Instead you should deliver the AC_LOST_DEVICE event to CAM on seeing a detach. Or am I misunderstanding your driver by chance? Nick On Tue, 9 Apr 2002, Thomas Quinot wrote: > Le 2002-04-09, Thomas Quinot =E9crivait : > > > problem with xpt_bus_deregister. Apparently, there is one reference > > to the bus which is counted but never released. As a consequence, > > a call to xpt_bus_deregister(cam_sim_path(scp->sim)) will not actually > > remove the bus from xpt_busses, and of course a subsequent cam_sim_free > > destroys the SIM with extreme prejudice. > > > > Any idea where I should start looking for this reference leak? > > OK, I think I found it. When attaching the SIM, I setup an > async callback on AC_LOST_DEVICE. This callback counts as > a reference to the wildcard device, which prevents the release > of the wildcard target, and therefore of the bus. Disabling > the callback before calling xpt_bus_deregister & al. resolved > the problem. > > I suspect that this problem is dormant in many other SCSI > host adapter drivers. Do others have experience with removing > a SIM from a running system? > > Thomas. > > --=20 n_hibma@van-laarhoven.org http://www.van-laarhoven.org/ n_hibma@FreeBSD.org http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020411124923.F31033-100000>