NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-mac68k/60701: mac68k: ascaudio(4) enables the VIA2 sound interrupt but does not handle it, flooding via2_noint(4)



>Number:         60701
>Category:       port-mac68k
>Synopsis:       mac68k: ascaudio(4) enables the VIA2 sound interrupt but does not handle it, flooding via2_noint(4)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-mac68k-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 09 12:45:00 +0000 2026
>Originator:     Ray Tran
>Release:        11.0
>Organization:
Diamond Creek Digital
>Environment:
Apple Macintosh Centris 650 running NetBSD 11.0
>Description:
On machines with A/UX-style interrupts (mac68k_machine.aux_interrupts,
which includes the Centris and Quadra 650) ascaudioattach() takes the
sound chip's line directly with intr_establish() at ASCIRQ.  It registers
nothing in the VIA2 slot.  ascaudio_intr_enable() then enables V2IF_ASC
in VIA2's interrupt enable register regardless of the mode.  VIA2 latches
the same line.  So for every FIFO half-full interrupt the driver services
at level 5, VIA2 raises a second interrupt at level 2.  That one lands in
via2_noint(), whose only effect is printf("via2_noint(4)").

The result on a Centris 650 with the 0xbb revision EASC chip is a dmesg full of
via2_noint(4) at the sound interrupt rate, one line every 17 to 35 ms
during playback.  Each of those is a console printf from interrupt
level, so there is an audible gap and a visible console glitch per FIFO
refill.  A 20 s tone at 440 Hz reads the correct pitch on a tuner but
has gaps.  The console bell floods dmesg before it sounds.  A 10 s clip
takes 12.2 s of wall time.

ASC_VIA_CLR_INTR() is defined at the top of ascaudio.c and never used,
which looks like the intended acknowledgement for this mode.  The
simpler fix is not to enable the VIA2 mirror at all when the line is
taken directly: with the VIA2 enable bit clear the flag is still latched
but never delivered.
>How-To-Repeat:
Boot an AUDIO kernel (ascaudio* at obio? flags 0x2, audio*,
spkr*, wsbell*) on a Centris 650 or Quadra 650 and play anything through
audioplay(1), or ring the console bell. 

dmesg floods with via2_noint(4) messages
>Fix:
Applies to sys/arch/mac68k/obio/ascaudio.c: return early from
ascaudio_intr_enable() when mac68k_machine.aux_interrupts is set.

With the fix, playback and the bell produce no via2_noint
lines.  The sound interrupt counter in vmstat -i still climbs at the
same rate, 177 interrupts for a 3 s clip and none while idle.  The gaps
and console glitches are gone.  The same patch applies to -current.

Applies with "patch -p1" from the top of usr/src; verified with -F0
(no fuzz) against NetBSD-current 11.99.8 (20260830003849Z) and 11.0.

--- a/sys/arch/mac68k/obio/ascaudio.c
+++ b/sys/arch/mac68k/obio/ascaudio.c
@@ -956,6 +956,17 @@
 {
 	int s;
 
+	if (mac68k_machine.aux_interrupts)
+		return;
+
 	s = splhigh();
 	if (VIA2 == VIA2OFF)
 		via2_reg(vIER) = 0x80 | V2IF_ASC;




Home | Main Index | Thread Index | Old Index