Re: page fault in mpu.c

2001-03-27 Thread Szilveszter Adam

On Mon, Mar 26, 2001 at 09:42:34PM -0500, Jim Bloom wrote:
 I finally tracked down the page fault I was seeing while probing the mpu.
 The mutex was not being initialized before it was used.  I have included a
 patch below which fixes the problem.  Will someone please review the style
 and commit the fix.

I can confirm that this fixes the problem (as in the kernel builds and
boots with options midi and sequencer.)

Thanks!
-- 
Regards:

Szilveszter ADAM
Szeged University
Szeged Hungary

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



page fault in mpu.c

2001-03-26 Thread Jim Bloom

I finally tracked down the page fault I was seeing while probing the mpu.
The mutex was not being initialized before it was used.  I have included a
patch below which fixes the problem.  Will someone please review the style
and commit the fix.

Thanks.

Jim Bloom
[EMAIL PROTECTED]


Index: mpu.c
===
RCS file: /users/ncvs/src/sys/dev/sound/isa/mpu.c,v
retrieving revision 1.5
diff -u -r1.5 mpu.c
--- mpu.c   2001/03/14 07:29:46 1.5
+++ mpu.c   2001/03/27 02:20:29
@@ -358,6 +358,8 @@
 
DEB(printf("mpu: attaching.\n"));
 
+   mtx_init(scp-mtx, "mpumid", MTX_DEF);
+
/* Allocate the resources, switch to uart mode. */
if (mpu_allocres(scp, dev) || mpu_uartmode(scp)) {
mpu_releaseres(scp, dev);
@@ -368,7 +370,6 @@
 
/* Fill the softc. */
scp-dev = dev;
-   mtx_init(scp-mtx, "mpumid", MTX_DEF);
scp-devinfo = devinfo = create_mididev_info_unit(MDT_MIDI, mpu_op_desc, 
midisynth_op_desc);
 
/* Fill the midi info. */
@@ -751,6 +752,7 @@
bus_release_resource(dev, SYS_RES_IOPORT, scp-io_rid, scp-io);
scp-io = NULL;
}
+   mtx_destroy(scp-mtx);
 }
 
 static device_method_t mpu_methods[] = {

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message