NetBSD Problem Report #60718
From www@netbsd.org Fri Sep 11 23:17:31 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)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 2CFD61A923B
for <gnats-bugs@gnats.NetBSD.org>; Fri, 11 Sep 2026 23:17:31 +0000 (UTC)
Message-Id: <20260911231729.C2C1D1A923C@mollari.NetBSD.org>
Date: Fri, 11 Sep 2026 23:17:29 +0000 (UTC)
From: raytran08@gmail.com
Reply-To: raytran08@gmail.com
To: gnats-bugs@NetBSD.org
Subject: mac68k: ascaudio(4) module block does not compile, and could not attach if it did
X-Send-Pr-Version: www-1.0
X-From4GNATS: "raytran08@gmail.com via gnats" <gnats-admin@NetBSD.org>
>Number: 60718
>Category: port-mac68k
>Synopsis: mac68k: ascaudio(4) module block does not compile, and could not attach if it did
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: nat
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Sep 11 23:20:00 +0000 2026
>Closed-Date: Thu Oct 15 15:34:07 +0000 2026
>Last-Modified: Thu Oct 15 15:34:07 +0000 2026
>Originator: Ray Tran
>Release: 11.0
>Organization:
Diamond Creek Digital
>Environment:
Hardware: Apple Macintosh Centris 650
Kernel: NetBSD 11.0 and CURRENT
>Description:
The _MODULE section at the end of sys/arch/mac68k/obio/ascaudio.c has
three problems, in increasing order of size.
1. It does not compile. It declares
static const struct cfiattrdata * const ascaudio_attrs[] = ...
extern struct cfattach ascaudio_ca;
and then uses ascaud_attrs in CFDRIVER_DECL() and ascaud_ca in the
four config_cfattach_attach/detach calls in ascaudio_modcmd().
Compiling the file with -D_MODULE gives
ascaudio.c:1024:34: error: 'ascaud_attrs' undeclared here
(not in a function); did you mean 'ascaudio_attrs'?
ascaudio.c:1054:70: error: 'ascaud_ca' undeclared (first use in
this function); did you mean 'ascaudio_ca'?
2. Once it compiled, loading it would panic. ascaudio_modcmd() brings
the device up with config_attach_pseudo(), which passes a NULL aux
to the attach function. ascaudioattach() casts aux to struct
obio_attach_args and reads oa_addr and oa_tag from it on its first
lines. ascaudiomatch() is not consulted at all on that path, so
nothing checks the machine either.
3. The way a modular obio driver should come up, by attaching at obio
after autoconfiguration, was not available when this was written:
obio had no rescan callback, and a driver loaded with modload(8) was
never probed. port-mac68k/60694 adds the rescan. With it in, the
block's job is a config_init_component() against the driver's
ioconf and a rescan of obio0, and the pseudo-device attach and the
hand-rolled cfdata can go.
There is no sys/modules/ascaudio, so there's no way to builds this block
currently and the kernel is unaffected. It is still wrong code in the tree, and
the first person to add a module Makefile hits all three in turn.
>How-To-Repeat:
>From a built tree, compile ascaudio.c with -D_MODULE added to the
kernel's flags. For the second problem, read ascaudio_modcmd() against
ascaudioattach().
>Fix:
This patch corrects the two identifiers so that the
block at least compiles as written. That is the smallest honest
change, and it does not make the module usable. What would, is either
removing the block until someone needs it, or rewriting it on top of
port-mac68k/60694 to attach through obio the way the rest of the port's
modular drivers do. Which of those is the author's call, and this
report is filed so the choice is made knowingly rather than by the
next person to try the block.
The rename is verified with -fsyntax-only -D_MODULE against the NetBSD
11.0 sources with the m68k cross compiler, and the kernel build with
the change is unaffected. It is independent of port-mac68k/60701 and
60702, which change other parts of the file. 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
@@ -1052,7 +1052,7 @@
&audiobuscf_iattrdata, NULL
};
-CFDRIVER_DECL(ascaudio, DV_DULL, ascaud_attrs);
+CFDRIVER_DECL(ascaudio, DV_DULL, ascaudio_attrs);
extern struct cfattach ascaudio_ca;
static int ascaudioloc[] = { -1, -1 };
@@ -1082,7 +1082,7 @@
return error;
}
- error = config_cfattach_attach(ascaudio_cd.cd_name, &ascaud_ca);
+ error = config_cfattach_attach(ascaudio_cd.cd_name, &ascaudio_ca);
if (error) {
config_cfdriver_detach(&ascaudio_cd);
aprint_error("%s: unable to register cfattach\n",
@@ -1093,7 +1093,7 @@
error = config_cfdata_attach(ascaudio_cfdata, 1);
if (error) {
- config_cfattach_detach(ascaudio_cd.cd_name, &ascaud_ca);
+ config_cfattach_detach(ascaudio_cd.cd_name, &ascaudio_ca);
config_cfdriver_detach(&ascaudio_cd);
aprint_error("%s: unable to register cfdata\n",
ascaudio_cd.cd_name);
@@ -1108,7 +1108,7 @@
if (error) {
return error;
}
- config_cfattach_detach(ascaudio_cd.cd_name, &ascaud_ca);
+ config_cfattach_detach(ascaudio_cd.cd_name, &ascaudio_ca);
config_cfdriver_detach(&ascaudio_cd);
aprint_error("%s: unable to register devsw\n",
ascaudio_cd.cd_name);
@@ -1125,7 +1125,7 @@
return error;
}
- config_cfattach_detach(ascaudio_cd.cd_name, &ascaud_ca);
+ config_cfattach_detach(ascaudio_cd.cd_name, &ascaudio_ca);
config_cfdriver_detach(&ascaudio_cd);
devsw_detach(NULL, &ascaudio_cdevsw);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-mac68k-maintainer->nat
Responsible-Changed-By: nat@NetBSD.org
Responsible-Changed-When: Tue, 15 Sep 2026 00:40:57 +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:04:59 +0000
State-Changed-Why:
the patch and for 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/60718 (mac68k: ascaudio(4) module block does not compile, and could not attach if it did)
Date: Wed, 16 Sep 2026 15:50:16 +1000
--Boundary-01=_Y4iqqtRr1Biijss
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Opps forgot to quote the PR with 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:44:36 +0000
Module Name: src
Committed By: nat
Date: Wed Sep 16 02:44:36 UTC 2026
Modified Files:
src/sys/arch/mac68k/obio: ascaudio.c
Log Message:
Fix typo for building ascaudio(4) as a module.
Patch and testing by Ray Tran.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21
src/sys/arch/mac68k/obio/ascaudio.c
Please note that diffs are not public domain; they are
subject
to the
copyright notices on the relevant files.
--Boundary-01=_Y4iqqtRr1Biijss
Content-Type: text/html;
charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Opps forgot to quote the PR with the commit.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">CVS commit: src/sys/arch/mac68k/obio</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> To: source-changes%NetBSD.org@localhost</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Subject: CVS commit: src/sys/arch/mac68k/obio</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> From: "Nathanial Sloss" <nat%netbsd.org@localhost></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Date: Wed, 16 Sep 2026 02:44:36 +0000</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Module Name: src</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Committed By: nat</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Date: Wed Sep 16 02:44:36 UTC 2026</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Modified Files:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> src/sys/arch/mac68k/obio: ascaudio.c</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Log Message:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Fix typo for building ascaudio(4) as a module.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Patch and testing by Ray Tran.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> To generate a diff of this commit:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> cvs rdiff -u -r1.20 -r1.21 src/sys/arch/mac68k/obio/ascaudio.c</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> Please note that diffs are not public domain; they are subject</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">to the</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> copyright notices on the relevant files.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p></body></html>
--Boundary-01=_Y4iqqtRr1Biijss--
State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: nat@NetBSD.org
State-Changed-When: Wed, 14 Oct 2026 06:12:28 +0000
State-Changed-Why:
Pullup -11 #528
State-Changed-From-To: pending-pullups->closed
State-Changed-By: nat@NetBSD.org
State-Changed-When: Thu, 15 Oct 2026 15:34:07 +0000
State-Changed-Why:
Pullups complete. Thanks for the report and patch.
>Unformatted:
(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.