NetBSD Problem Report #59719

From www@netbsd.org  Thu Oct 23 21:41:12 2025
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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 87CE01A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Oct 2025 21:41:12 +0000 (UTC)
Message-Id: <20251023214111.515741A923A@mollari.NetBSD.org>
Date: Thu, 23 Oct 2025 21:41:11 +0000 (UTC)
From: nia@pkgsrc.org
Reply-To: nia@pkgsrc.org
To: gnats-bugs@NetBSD.org
Subject: emuxki(4) panics during attach
X-Send-Pr-Version: www-1.0

>Number:         59719
>Category:       kern
>Synopsis:       emuxki(4) panics during attach
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    khorben
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 23 21:45:00 +0000 2025
>Closed-Date:    
>Last-Modified:  Sat Feb 07 22:30:01 +0000 2026
>Originator:     niah allery (according to some english people)
>Release:        current
>Organization:
The NetBSD Foundation
>Environment:
NetBSD siphon 11.99.3 NetBSD 11.99.3 (SIPHON) #13: Thu Oct 23 23:06:13 CEST 2025  nia@siphon:/encrypt/obj/sys/arch/amd64/compile/SIPHON amd64
>Description:
[    24.009249] emuxki0 at pci5 dev 0 function 0: Creative Labs SB Audigy 4 (rev. 0x00)
[    24.014131] emuxki0: Sound Blaster Audigy Rx [SB1550]
[    24.014131] emuxki0: interrupting at ioapic1 pin 4
[    24.022919] panic: kernel diagnostic assertion "(addr & 0xff000000) == 0" failed: file "/encrypt/src/sys/dev/pci/emuxki.c", line 336 
[    24.022919] cpu1: Begin traceback...
[    24.023896] vpanic() at netbsd:vpanic+0x189
[    24.023896] kern_assert() at netbsd:kern_assert+0x4b
[    24.024872] emuxki_attach() at emuxki:emuxki_attach+0x1216
[    24.024872] config_attach_internal() at netbsd:config_attach_internal+0x1e0
[    24.025849] config_found_acquiound() at netbsd:config_found+0x31
[    24.026825] pci_probe_devirate_bus1() at netbsd:pci_enumerate_bus1+0x197
[    24.026825] pcirescan() at netbsd:pcirescan+0x4a
[    24.027802] config_cfdata_attach() at netbsd:config_cfdata_attach+0xed
[    24.028778] config_init_component() at netbsd:config_init_component+0x8e
[    24.028778] module_do_load() at netbsd:module_do_load+0x726
[    24.029755] module_load() at netbsd:module_load+0x84
[    24.029755] handle_modctl_load() at netbsd:handle_modctl_load+0x133
[    24.030731] sys_modctl() at netbsd:sys_modctl+0x36a
[    24.031708] syscall() at netbsd:syscall+0x9d
[    24.031708] --- syscall (number 246) ---
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->khorben
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Thu, 23 Oct 2025 21:52:49 +0000
Responsible-Changed-Why:
Can you take a look?


From: nia <nia@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/59719: emuxki(4) panics during attach
Date: Thu, 23 Oct 2025 22:23:50 +0000

 Quite unsurprisingly these lines are the cause of the assertion
 always firing:

 emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
     emuxki_read(sc, 0, EMU_A2_SPDIF_SAMPLERATE) & 0xfffff1ff);

 static uint32_t
 emuxki_read(struct emuxki_softc *sc, int ch, int addr)
 {

 	/* Original HENTAI addressing is never supported. */
 	KASSERT((addr & 0xff000000) == 0);

 	return emuxki_readptr(sc, EMU_PTR, EMU_DATA, (addr << 16) + ch);
 }

From: Pierre Pronchery <khorben@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org,
 netbsd-bugs@netbsd.org,
 gnats-admin@netbsd.org,
 "riastradh@netbsd.org" <riastradh@NetBSD.org>,
 nia@pkgsrc.org
Subject: Re: kern/59719 (emuxki(4) panics during attach)
Date: Thu, 23 Oct 2025 18:23:01 -0600

 > On 23 Oct 2025, at 15:52, riastradh@netbsd.org <riastradh@NetBSD.org> =
 wrote:
 >=20
 > Synopsis: emuxki(4) panics during attach
 >=20
 > Responsible-Changed-From-To: kern-bug-people->khorben
 > Responsible-Changed-By: riastradh@NetBSD.org
 > Responsible-Changed-When: Thu, 23 Oct 2025 21:52:49 +0000
 > Responsible-Changed-Why:
 > Can you take a look?

 In a couple weeks hopefully yes; I don=E2=80=99t have access to my
 emuxki(4) hardware at the moment.

 --=20
 khorben=

From: nia <nia@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/59719 (emuxki(4) panics during attach)
Date: Fri, 24 Oct 2025 10:22:13 +0000

 --F9G0s+KdhNGwsJWW
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 This patch appears to be enough to get the sound card to attach without
 panicking. It was derived by inspecting the other BSDs' code, and
 realizing that the A2_SPDIF sample rate shouldn't be initialized here
 for CA0108, but rather the A_SPDIF.

 The sound card does emit a loud extremely high pitched scream, enough
 to wake up every dog in the neighbourhood. Mixer controls seem to
 have no effect. So there's still something wrong with initialization,
 probably.

 --F9G0s+KdhNGwsJWW
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=emuxki.diff

 Index: emuxki.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/emuxki.c,v
 retrieving revision 1.79
 diff -u -p -r1.79 emuxki.c
 --- emuxki.c	8 Jun 2024 21:02:29 -0000	1.79
 +++ emuxki.c	24 Oct 2025 10:19:20 -0000
 @@ -604,9 +604,13 @@ emuxki_init(struct emuxki_softc *sc)
  	emuxki_write(sc, 0, EMU_SPCS2, spcs);

  	if (sc->sc_type & EMUXKI_AUDIGY2_CA0108) {
 +		uint32_t sr;
 +
  		/* Setup SRCMulti_I2S SamplingRate */
 -		emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
 -		    emuxki_read(sc, 0, EMU_A2_SPDIF_SAMPLERATE) & 0xfffff1ff);
 +		sr = emuxki_read(sc, 0, EMU_A_SPDIF_SAMPLERATE);
 +		sr &= 0xfffff1ff;
 +		sr |= 0x400; /* 96 KHz */
 +		emuxki_write(sc, 0, EMU_A_SPDIF_SAMPLERATE, sr);

  		/* Setup SRCSel (Enable SPDIF, I2S SRCMulti) */
  		emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA, EMU_A2_SRCSEL,

 --F9G0s+KdhNGwsJWW--

State-Changed-From-To: open->analyzed
State-Changed-By: nia@NetBSD.org
State-Changed-When: Fri, 24 Oct 2025 12:46:34 +0000
State-Changed-Why:


From: nia <nia@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/59719 (emuxki(4) panics during attach)
Date: Fri, 9 Jan 2026 16:41:34 +0000

 On Fri, Oct 24, 2025 at 12:25:01AM +0000, Pierre Pronchery via gnats wrote:
 >  In a couple weeks hopefully yes; I don=E2=80=99t have access to my
 >  emuxki(4) hardware at the moment.

 Hey khorben, have you had a chance to look at this again?

From: Pierre Pronchery <khorben@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/59719 (emuxki(4) panics during attach)
Date: Sat, 7 Feb 2026 23:29:42 +0100

 --Apple-Mail=_6B0ABC7B-C5D8-455A-97D6-E99534ACA086
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=utf-8

 			Hi there,

 Sorry for the delay; I had to change test equipment to be able to fit =
 the
 card again.

 I could reproduce the panic and therefore confirm the issue here. I=E2=80=99=
 ll
 look into it ASAP.

 Cheers,
 --=20
 khorben=

 --Apple-Mail=_6B0ABC7B-C5D8-455A-97D6-E99534ACA086
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----

 iQIzBAEBCAAdFiEEjPEp1wC4bxBrX8svMDjL25iGlwMFAmmHvNYACgkQMDjL25iG
 lwMPaw/8ClQ2n0YifwGWHlani240fIAJGOowvYA7gQJ+xvll0xGFIgWBCqwh/1AZ
 M0FteakQ6kD6jf8FsNcXv73BddTBK2mKluKzpuqZPGnM8lqTtx6QBNE0F/IgZOCe
 nyWdJfTkBkR2wFRKR+3F+In7zjfTd/+O4+fB0UdeQjSbOwt+m51o1JJH4NOTbzD5
 pIUmEb8yNbQH3gbgxXkpN0BQUsD+VrV4+z0YsFRXf2wOnET0Dw1dGCn3O4P6MzO8
 +BlIwGqaPYffEkt8fTkgAS2lowKu3TUk0hJ1x6XOWOE06lcX9QTdYJckcrQANvoN
 6G0xkw4p1motI2qy+ojCpBECkdfnmx4kJ2++JP1+fAIOut+WNGcLkBMHoneIE3kg
 yLr223d8/X4de/wUZZ6ZMJZjwpuHo4v/YAL6bMb6MbXLwykJM4sxkv9TKwlYARGE
 twsnG15Tn/PH393pVVUkxOfe3VL5rohZXQejW/MOCTTJhNqaM5PiqU00FI5Sq5LA
 zR/xyLxmQEbcEfwFrYEG1IFR+YxawGU18NhB8y68tJK0wXEF9csYulxWGwwd4TcH
 FlJx6jHuN3LOkoDOmg2yZPgBSxAwfdRTSX1Mw48S1nx5qC1AvkH67FqJcpWblfwU
 G4Gm0gGqSufS0baypVqD76z0z0KT5JI84uvI0m9cN3kYeiob6as=
 =4I9E
 -----END PGP SIGNATURE-----

 --Apple-Mail=_6B0ABC7B-C5D8-455A-97D6-E99534ACA086--

>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.