Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Jul 2005 19:04:23 -0500
From:      Jonathan Noack <noackjr@alumni.rice.edu>
To:        Ariff Abdullah <skywizard@MyBSD.org.my>
Cc:        freebsd-multimedia@freebsd.org, mat@cnd.mcgill.ca
Subject:   Re: Massive sound changes / fix (24/32bit pcm support, new sampling rate converter, various fixes)
Message-ID:  <42D06607.20307@alumni.rice.edu>
In-Reply-To: <20050710051523.0a67cd91.skywizard@MyBSD.org.my>
References:  <42D02CA9.4080201@alumni.rice.edu> <20050710051523.0a67cd91.skywizard@MyBSD.org.my>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig85008349A05A9F4CCC2523DD
Content-Type: multipart/mixed; boundary="------------050908000006080801060802"

This is a multi-part message in MIME format.
--------------050908000006080801060802
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 07/09/05 16:15, Ariff Abdullah wrote:
> There are few LORs (during boot) with this much integrated es137x
> (which I do believe false positives). Perhaps you can reproduce
> it by enabling WITNESS?
> 
> http://staff.mybsd.org.my/skywizard/FreeBSD/sound/LOR/es137x_lor.txt
> (This is slightly outdated, some of it have bean dealt with)

The LORs didn't happen with my old patch even though the direct code in 
question doesn't appear to have changed.  I'll keep digging, but my 
first high-level pass didn't reveal anything wrong.

I AM getting a lot of the following:
sysctl_old_user() with the following non-sleepable locks held:
exclusive sleep mutex pcm0 (sound softc)...

You can't hold the es->lock over a sysctl_handle_int call.  See attached 
patch.  Note that it performs an unlocked read of the current status of 
es1371x_spdif_en or es1371_latency_timer, but I think this is safe.  If 
not, we'll have to lock, get the current status, unlock for the 
sysctl_handle_int call, and then relock...

-- 
Jonathan Noack | noackjr@alumni.rice.edu | OpenPGP: 0x991D8195

--------------050908000006080801060802
Content-Type: text/x-patch;
 name="es137x_sysctl.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="es137x_sysctl.diff"

--- es137x.c.diff	Sat Jul  9 18:48:31 2005
+++ es137x.c	Sat Jul  9 18:53:23 2005
@@ -897,18 +897,14 @@
 
 	dev = oidp->oid_arg1;
 	es = pcm_getdevinfo(dev);
-	snd_mtxlock(es->lock);
 	new_en = es1371x_spdif_en;
 	err = sysctl_handle_int(oidp, &new_en, sizeof(new_en), req);
-	if (err || req->newptr == NULL) {
-		snd_mtxunlock(es->lock);
+	if (err || req->newptr == NULL)
 		return err;
-	}
-	if (new_en < 0 || new_en > 1) {
-		snd_mtxunlock(es->lock);
+	if (new_en < 0 || new_en > 1)
 		return EINVAL;
-	}
 
+	snd_mtxlock(es->lock);
 	es1371x_spdif_en = new_en;
 	r = es_rd(es, ES1370_REG_STATUS, 4);
 	if (new_en) {
@@ -938,17 +934,14 @@
 
 	dev = oidp->oid_arg1;
 	es = pcm_getdevinfo(dev);
-	snd_mtxlock(es->lock);
 	new_val = es1371_latency_timer;
 	err = sysctl_handle_int(oidp, &new_val, sizeof(new_val), req);
-	if (err || req->newptr == NULL) {
-		snd_mtxunlock(es->lock);
+	if (err || req->newptr == NULL)
 		return err;
-	}
-	if (new_val < 0 || new_val > 255) {
-		snd_mtxunlock(es->lock);
+	if (new_val < 0 || new_val > 255)
 		return EINVAL;
-	}
+
+	snd_mtxlock(es->lock);
 	pci_write_config(dev, PCIR_LATTIMER, new_val, 1);
 	es1371_latency_timer = pci_read_config(dev, PCIR_LATTIMER, 1);
 	snd_mtxunlock(es->lock);

--------------050908000006080801060802--

--------------enig85008349A05A9F4CCC2523DD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQFC0GYMUFz01pkdgZURAsMhAKDSnNp2TY93n/QolmIHwImFBW+C/ACfYqXA
QAXmvLCxhmV1N0129eA+1fY=
=1plV
-----END PGP SIGNATURE-----

--------------enig85008349A05A9F4CCC2523DD--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42D06607.20307>