Subject: ASC testers needed (LCII especially)
To: Robert Billings <rbilling@aros.net>
From: Colin Wood <cwood@ichips.intel.com>
List: port-mac68k
Date: 06/08/1999 23:30:26
hi all!

i _think_ i've figured out why the LCII was hanging on the 1.4ALPHA
kernels.  after managing to produce something astonishly similar on my
IIci, i believe that what was happening was basically an infinite loop
through the ASC interrupt handler due to the chip being set to scan the
sound buffers uselessly.  so, i have a patch attached below which should
fix that much.  if you can build your own kernels (whether or not you
have an LCII), please try the patch and let me know whether or not it
works for you.  it should apply to 1.4 or -current source, i believe.  if
the patch does work for everyone (LCII's and others), i'll go ahead and
commit the fix.  oh, if you wouldn't mind, also try to make it beep (hit
^G in a shell or something) whether it your sound hardware actually beeps
or not.  i'd like to make sure that it doesn't hang the machine to do so
;-)

thanks!

colin

Index: asc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/mac68k/obio/asc.c,v
retrieving revision 1.31
diff -u -r1.31 asc.c
--- asc.c	1999/04/22 18:00:34	1.31
+++ asc.c	1999/06/09 06:18:03
@@ -99,10 +99,8 @@
 
 static int	asc_ring_bell __P((void *, int, int, int));
 static void	asc_stop_bell __P((void *));
-#if __notyet__
 static void	asc_intr_enable __P((void));
 static void	asc_intr __P((void *));
-#endif
 
 static int	ascmatch __P((struct device *, struct cfdata *, void *));
 static void	ascattach __P((struct device *, struct device *, void *));
@@ -188,10 +186,8 @@
 	printf("\n");
 
 	mac68k_set_bell_callback(asc_ring_bell, sc);
-#if __notyet__
 	via2_register_irq(VIA2_ASC, asc_intr, sc);
 	asc_intr_enable();
-#endif
 }
 
 int
@@ -366,13 +362,19 @@
 		bus_space_write_1(sc->sc_tag, sc->sc_handle, 0x801, 0);
 }
 
-#if __notyet__
 static void
 asc_intr_enable()
 {
 	int s;
 
 	s = splhigh();
+
+	/*
+	 * Disable scanning of the sound buffers or enabling interrupts
+	 * may hang the machine
+	 */
+	bus_space_write_1(sc->sc_tag, sc->sc_handle, 0x801, 0);
+
 	if (VIA2 == VIA2OFF)
 		via2_reg(vIER) = 0x80 | V2IF_ASC;
 	else
@@ -393,4 +395,3 @@
 		printf("asc_intr(%p)\n", sc);
 #endif
 }
-#endif