Interesting, yet stupid test case
Sean Bruno
sean_bruno at yahoo.com
Fri Aug 23 17:05:09 UTC 2013
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);
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freebsd.org/pipermail/freebsd-scsi/attachments/20130823/578655b0/attachment.sig>
More information about the freebsd-scsi
mailing list