From owner-freebsd-current Mon Dec 2 6:25:53 2002 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 1DB5E37B401; Mon, 2 Dec 2002 06:25:52 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 975E243E4A; Mon, 2 Dec 2002 06:25:51 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from vigrid.com (tnt-77-123.ct.dialin.ntplx.com [209.54.77.123]) by mail.pcnet.com (8.12.3/8.12.1) with ESMTP id gB2EPmdp025577; Mon, 2 Dec 2002 09:25:49 -0500 (EST) Message-ID: <3DEB6CC9.7AD4F67D@vigrid.com> Date: Mon, 02 Dec 2002 09:23:05 -0500 From: Daniel Eischen X-Mailer: Mozilla 4.74 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: current@freebsd.org Cc: jhb@freebsd.org, tanimura@freebsd.org Subject: [PATCH] mtx_unowned panic at mpu.c:releaseres(). Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [ jhb and tanimura CC'd because they are the last two to touch mpu.c ] I have a maestro3 sound card in a Dell lattitude C600. Configuring pcm, midi, and seq in KERNCONF results in that kernel panic'ing in mpu.c:releaseres() at mtx_destroy(). I'm guessing it is because the mutex isn't yet created since releaseres() is most often called from the probe() functions. This fixes the panic, but I'm not sure what the original intent of the authors were. FYI, emu0 and mpu0 fail to probe/attach on my system. emu0: Resource alloc failed, pnp_quirks may need { 0x00000000, 0x00000000 } mpu0: reset failed. Here's the patch that I'm using: -- Dan Eischen %%% Index: dev/sound/isa/mpu.c =================================================================== RCS file: /opt/FreeBSD/cvs/src/sys/dev/sound/isa/mpu.c,v retrieving revision 1.16 diff -u -r1.16 mpu.c --- dev/sound/isa/mpu.c 4 Apr 2002 21:03:16 -0000 1.16 +++ dev/sound/isa/mpu.c 2 Dec 2002 06:43:18 -0000 @@ -363,6 +363,7 @@ /* Allocate the resources, switch to uart mode. */ if (mpu_allocres(scp, dev) || mpu_uartmode(scp)) { mpu_releaseres(scp, dev); + mtx_destroy(&scp->mtx); return (ENXIO); } @@ -769,7 +770,6 @@ bus_release_resource(dev, SYS_RES_IOPORT, scp->io_rid, scp->io); scp->io = NULL; } - mtx_destroy(&scp->mtx); } %%% To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message