NetBSD Problem Report #60701

From www@netbsd.org  Wed Sep  9 12:40:22 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BA7E21A923B
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  9 Sep 2026 12:40:22 +0000 (UTC)
Message-Id: <20260909124021.734001A923C@mollari.NetBSD.org>
Date: Wed,  9 Sep 2026 12:40:21 +0000 (UTC)
From: raytran08@gmail.com
Reply-To: raytran08@gmail.com
To: gnats-bugs@NetBSD.org
Subject: mac68k: ascaudio(4) enables the VIA2 sound interrupt but does not handle it, flooding via2_noint(4)
X-Send-Pr-Version: www-1.0
X-From4GNATS: "raytran08@gmail.com via gnats" <gnats-admin@NetBSD.org>

>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:    nat
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 09 12:45:00 +0000 2026
>Closed-Date:    Thu Oct 15 15:32:27 +0000 2026
>Last-Modified:  Thu Oct 15 15:32:27 +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;

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-mac68k-maintainer->nat
Responsible-Changed-By: nat@NetBSD.org
Responsible-Changed-When: Thu, 10 Sep 2026 11:11:02 +0000
Responsible-Changed-Why:
Take.


State-Changed-From-To: open->needs-pullups
State-Changed-By: nat@NetBSD.org
State-Changed-When: Wed, 16 Sep 2026 03:01:42 +0000
State-Changed-Why:
Patch applied.  Thank you to Ray Tran for supplying a patch and testing.


From: Nathanial Sloss <nathanialsloss@yahoo.com.au>
To: gnats-bugs@netbsd.org
Cc: netbsd-bugs@netbsd.org,
 gnats-admin@netbsd.org,
 raytran08@gmail.com
Subject: Re: port-mac68k/60701 (mac68k: ascaudio(4) enables the VIA2 sound interrupt but does not handle it, flooding via2_noint(4))
Date: Wed, 16 Sep 2026 15:43:49 +1000

 On Wed, 16 Sep 2026 13:01:43 nat@netbsd.org wrote:
 ....Opps...forgot to quote the PR in the commit.

 CVS commit: src/sys/arch/mac68k/obio

     To: source-changes%NetBSD.org@localhost
         Subject: CVS commit: src/sys/arch/mac68k/obio
             From: "Nathanial Sloss" <nat%netbsd.org@localhost>
                 Date: Wed, 16 Sep 2026 02:40:05 +0000

                 Module Name:    src
                 Committed By:   nat
                 Date:           Wed Sep 16 02:40:05 UTC 2026

                 Modified Files:
                         src/sys/arch/mac68k/obio: ascaudio.c

                         Log Message:
                         Return early if aux.interrupts.

                         Patch and testing by Ray Tran.


                         To generate a diff of this commit:
                         cvs rdiff -u -r1.18 -r1.19 
 src/sys/arch/mac68k/obio/ascaudio.c

                         Please note that diffs are not public domain; they are 
 s
 ubject to the
                         copyright notices on the relevant files.

State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: nat@NetBSD.org
State-Changed-When: Wed, 14 Oct 2026 06:15:13 +0000
State-Changed-Why:
Pullup -11 #530


State-Changed-From-To: pending-pullups->closed
State-Changed-By: nat@NetBSD.org
State-Changed-When: Thu, 15 Oct 2026 15:32:27 +0000
State-Changed-Why:
Pullups complete.  Thanks for the report and patch.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.