From owner-freebsd-multimedia@FreeBSD.ORG Sun Jul 10 00:04:35 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E8BF16A41C for ; Sun, 10 Jul 2005 00:04:35 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: from smtp107.sbc.mail.mud.yahoo.com (smtp107.sbc.mail.mud.yahoo.com [68.142.198.206]) by mx1.FreeBSD.org (Postfix) with SMTP id 1AAAB43D49 for ; Sun, 10 Jul 2005 00:04:34 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: (qmail 24372 invoked from network); 10 Jul 2005 00:04:34 -0000 Received: from unknown (HELO optimator.noacks.org) (noacks@swbell.net@70.240.213.247 with login) by smtp107.sbc.mail.mud.yahoo.com with SMTP; 10 Jul 2005 00:04:34 -0000 Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id 89CCE60EB; Sat, 9 Jul 2005 19:04:33 -0500 (CDT) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 00635-02; Sat, 9 Jul 2005 19:04:30 -0500 (CDT) Received: from compgeek.noacks.org (compgeek [192.168.1.10]) by optimator.noacks.org (Postfix) with ESMTP id 89B0460E8; Sat, 9 Jul 2005 19:04:30 -0500 (CDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by compgeek.noacks.org (8.13.4/8.13.4) with ESMTP id j6A04SOu001080; Sat, 9 Jul 2005 19:04:29 -0500 (CDT) (envelope-from noackjr@alumni.rice.edu) Message-ID: <42D06607.20307@alumni.rice.edu> Date: Sat, 09 Jul 2005 19:04:23 -0500 From: Jonathan Noack User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050428) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ariff Abdullah References: <42D02CA9.4080201@alumni.rice.edu> <20050710051523.0a67cd91.skywizard@MyBSD.org.my> In-Reply-To: <20050710051523.0a67cd91.skywizard@MyBSD.org.my> X-Enigmail-Version: 0.91.0.0 OpenPGP: id=991D8195; url=http://www.noacks.org/cert/noackjr.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig85008349A05A9F4CCC2523DD" X-Virus-Scanned: amavisd-new at noacks.org 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) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2005 00:04:35 -0000 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--