Date: Tue, 16 Sep 2003 14:52:46 +0200 From: Thomas Quinot <thomas@FreeBSD.ORG> To: Petri Helenius <pete@he.iki.fi> Cc: Soeren Schmidt <sos@spider.deepcore.dk> Subject: Re: atapicam panic Message-ID: <20030916125246.GC47779@melusine.cuivre.fr.eu.org> In-Reply-To: <3F5A1AA2.9060508@he.iki.fi> References: <3F5A1AA2.9060508@he.iki.fi>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Le 2003-09-06, Petri Helenius écrivait :
> 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...
> panic: mutex Giant not owned at ../../../dev/ata/atapi-cam.c:117
Please try this patch.
Index: atapi-cam.c
===================================================================
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 = NULL;
int unit;
- GIANT_REQUIRED;
-
if (mtx_initialized(&atapicam_softc_mtx) == 0)
mtx_init(&atapicam_softc_mtx, "ATAPI/CAM softc mutex", NULL, MTX_DEF);
mtx_lock(&atapicam_softc_mtx);
-
LIST_FOREACH(scp, &all_buses, chain) {
if (scp->ata_ch == ata_ch)
break;
@@ -130,10 +127,12 @@
if (scp != NULL)
return;
- if ((scp = malloc(sizeof(struct atapi_xpt_softc),
- M_ATACAM, M_NOWAIT | M_ZERO)) == NULL)
- goto error;
+ scp = malloc(sizeof(struct atapi_xpt_softc),
+ M_ATACAM, M_NOWAIT | M_ZERO));
+ mtx_lock (&Giant);
+ if (scp == NULL)
+ goto error;
scp->ata_ch = ata_ch;
TAILQ_INIT(&scp->pending_hcbs);
LIST_INSERT_HEAD(&all_buses, scp, chain);
@@ -165,10 +164,12 @@
setup_async_cb(scp, AC_LOST_DEVICE);
reinit_bus(scp, cold ? BOOT_ATTACH : ATTACH);
+ mtx_unlock (&Giant);
return;
error:
free_softc(scp);
+ mtx_unlock (&Giant);
}
void
--
Thomas.Quinot@Cuivre.FR.EU.ORG
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQE/ZwedAE1UuDk9JGkRAlNLAJ9gGTGOi6tNgO011sKGXbr+Kgh7zwCfdhfu
Evapv/zkzcfL8f38Q+hucJ0=
=mdeZ
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030916125246.GC47779>
