Skip site navigation (1)Skip section navigation (2)
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>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

--=-19vJrLjt1memIyAEdgDw
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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=20
> >=20
> > 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
> >=20
> > System will attempt to process all the events in the controller on boot
> > up and die violently.  :-)
>=20
> Yuck. :(
>=20
> 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().
>=20
> 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).
>=20
> Thanks,
> -Mark
>=20
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
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- mfi_cam.c	(revision 254539)
> +++ mfi_cam.c	(working copy)
> @@ -307,10 +307,10 @@
>  		return;
>  	}
>  	camsc->state =3D MFIP_STATE_RESCAN;
> -	mtx_unlock(&sc->mfi_io_lock);
> =20
>  	ccb =3D xpt_alloc_ccb_nowait();
>  	if (ccb =3D=3D NULL) {
> +		mtx_unlock(&sc->mfi_io_lock);
>  		device_printf(sc->mfi_dev,
>  		    "Cannot allocate ccb for bus rescan.\n");
>  		return;
> @@ -317,7 +317,6 @@
>  	}
> =20
>  	sim =3D 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) !=3D 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);
> =20
> -	mtx_lock(&sc->mfi_io_lock);
>  	camsc->state =3D MFIP_STATE_NONE;
>  	mtx_unlock(&sc->mfi_io_lock);
>  }


--=-19vJrLjt1memIyAEdgDw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----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-----

--=-19vJrLjt1memIyAEdgDw--




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?1377277183.1469.6.camel>