From owner-freebsd-current@FreeBSD.ORG Tue Sep 16 05:52:49 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 488E516A4B3 for ; Tue, 16 Sep 2003 05:52:49 -0700 (PDT) Received: from melusine.cuivre.fr.eu.org (melusine.cuivre.fr.eu.org [62.212.105.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5350243FB1 for ; Tue, 16 Sep 2003 05:52:48 -0700 (PDT) (envelope-from thomas@FreeBSD.ORG) Received: by melusine.cuivre.fr.eu.org (Postfix, from userid 1000) id DE4E32C3D0; Tue, 16 Sep 2003 14:52:46 +0200 (CEST) Date: Tue, 16 Sep 2003 14:52:46 +0200 From: Thomas Quinot To: Petri Helenius Message-ID: <20030916125246.GC47779@melusine.cuivre.fr.eu.org> References: <3F5A1AA2.9060508@he.iki.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline In-Reply-To: <3F5A1AA2.9060508@he.iki.fi> User-Agent: Mutt/1.4i X-message-flag: WARNING! Using Outlook can damage your computer. cc: freebsd-current@freebsd.org cc: Soeren Schmidt Subject: Re: atapicam panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2003 12:52:49 -0000 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le 2003-09-06, Petri Helenius =E9crivait : > Should this work or is the work to port this to ATAng still undergoing? This should work, but does not, so the work is still in progress... =20 > panic: mutex Giant not owned at ../../../dev/ata/atapi-cam.c:117 Please try this patch. Index: atapi-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 RCS file: /home/ncvs/src/sys/dev/ata/atapi-cam.c,v retrieving revision 1.22 diff -u -r1.22 atapi-cam.c --- atapi-cam.c 11 Sep 2003 17:34:47 -0000 1.22 +++ atapi-cam.c 16 Sep 2003 12:51:35 -0000 @@ -114,13 +114,10 @@ struct cam_path *path =3D NULL; int unit; =20 - GIANT_REQUIRED; - if (mtx_initialized(&atapicam_softc_mtx) =3D=3D 0) mtx_init(&atapicam_softc_mtx, "ATAPI/CAM softc mutex", NULL, MTX_DEF); =20 mtx_lock(&atapicam_softc_mtx); - LIST_FOREACH(scp, &all_buses, chain) { if (scp->ata_ch =3D=3D ata_ch) break; @@ -130,10 +127,12 @@ if (scp !=3D NULL) return; =20 - if ((scp =3D malloc(sizeof(struct atapi_xpt_softc), - M_ATACAM, M_NOWAIT | M_ZERO)) =3D=3D NULL) - goto error; + scp =3D malloc(sizeof(struct atapi_xpt_softc), + M_ATACAM, M_NOWAIT | M_ZERO)); =20 + mtx_lock (&Giant); + if (scp =3D=3D NULL) + goto error; scp->ata_ch =3D ata_ch; TAILQ_INIT(&scp->pending_hcbs); LIST_INSERT_HEAD(&all_buses, scp, chain); @@ -165,10 +164,12 @@ =20 setup_async_cb(scp, AC_LOST_DEVICE); reinit_bus(scp, cold ? BOOT_ATTACH : ATTACH); + mtx_unlock (&Giant); return; =20 error: free_softc(scp); + mtx_unlock (&Giant); } =20 void --=20 Thomas.Quinot@Cuivre.FR.EU.ORG --BOKacYhQ+x31HxR3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/ZwedAE1UuDk9JGkRAlNLAJ9gGTGOi6tNgO011sKGXbr+Kgh7zwCfdhfu Evapv/zkzcfL8f38Q+hucJ0= =mdeZ -----END PGP SIGNATURE----- --BOKacYhQ+x31HxR3--