Date: Fri, 23 Aug 2013 09:59:43 -0700 From: Sean Bruno <sean_bruno@yahoo.com> To: Mark Johnston <markj@freebsd.org> Cc: "FreeBSD-scsi@freebsd.org" <FreeBSD-scsi@freebsd.org> Subject: Re: Interesting, yet stupid test case Message-ID: <1377277183.1469.6.camel@localhost> In-Reply-To: <20130819185426.GA4765@charmander.sandvine.com> References: <1376934295.1455.4.camel@localhost> <20130819185426.GA4765@charmander.sandvine.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Mon, 2013-08-19 at 14:54 -0400, Mark Johnston wrote:
> On Mon, Aug 19, 2013 at 10:44:54AM -0700, Sean Bruno wrote:
> > Was able to get mfi to detonate (via CAM) today on stable/9
> >
> > At the loader prompt, physically remove some amount of drives (in my
> > case drives 0-5, as 6-11 are my zroot). Boot up into single user via
> > boot -s
> >
> > System will attempt to process all the events in the controller on boot
> > up and die violently. :-)
>
> Yuck. :(
>
> I think we're not supposed to drop the SIM lock before calling
> xpt_rescan(); the other drivers I've looked at don't do this at least.
> We're also unnecessarily dropping the mfi lock around the call to
> xpt_alloc_ccb_nowait().
>
> I think the following (untested) patch should help. I can try testing it
> myself later if I can get a hold of some equipment at work (might take a
> few days).
>
> Thanks,
> -Mark
>
Yup, this fixes the panic on startup on a Dell H310 if I pull 3 disks
out at the loader prompt and then continue to boot.
Sean
> Index: mfi_cam.c
> ===================================================================
> --- mfi_cam.c (revision 254539)
> +++ mfi_cam.c (working copy)
> @@ -307,10 +307,10 @@
> return;
> }
> camsc->state = MFIP_STATE_RESCAN;
> - mtx_unlock(&sc->mfi_io_lock);
>
> ccb = xpt_alloc_ccb_nowait();
> if (ccb == NULL) {
> + mtx_unlock(&sc->mfi_io_lock);
> device_printf(sc->mfi_dev,
> "Cannot allocate ccb for bus rescan.\n");
> return;
> @@ -317,7 +317,6 @@
> }
>
> sim = camsc->sim;
> - mtx_lock(&sc->mfi_io_lock);
> if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim),
> tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
> xpt_free_ccb(ccb);
> @@ -326,11 +325,8 @@
> "Cannot create path for bus rescan.\n");
> return;
> }
> - mtx_unlock(&sc->mfi_io_lock);
> -
> xpt_rescan(ccb);
>
> - mtx_lock(&sc->mfi_io_lock);
> camsc->state = MFIP_STATE_NONE;
> mtx_unlock(&sc->mfi_io_lock);
> }
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (FreeBSD)
iQEcBAABAgAGBQJSF5T3AAoJEBkJRdwI6BaH/UwH/ijMLnZ8mTx5IhqF00wSwSLN
WBDU7zjc7GDjamlkF3fz6v98GEthddEW7UlUaqwchX9Y+uv26/MmVqUUhNwnHThH
gfptUN3S+ClkL8ZfqBADirnF4mlmzG1vl5H38Mnkqpv90IBM9eACTp1lsZ9BHWTc
yGSRID9qxjH1K5fbvtThWNLY9xKKaK7vTPjWeBInTQb5t7/TJei76fvOdhrWdSFQ
e3lP1Wor1pQO1Ztvw+q5d7oITl9FfwhuoZS39zHy0LxYorzTL7/EhPySv1Ojlufk
7fPmT7Q0qBc/vGPYa51DqTQlmgJ57eLASt67+kLnjfBbdHw5BLPgalLbAkxFdyU=
=k4Px
-----END PGP SIGNATURE-----
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1377277183.1469.6.camel>
