Repository navigation
drm/asahi: g18: Make the GPU driver load again when G18 is built (one __param section, not two) - #1972
Merged
DjDeveloperr merged 1 commit intoNov 17, 2026
Conversation
… __param section, not two) Since aurora-silicon#1939 turned the G18 backend on in the shared defaults (CONFIG_DRM_ASAHI_G18=y), aurora.ko no longer loads, so no Apple GPU probes, on any generation: sysfs: cannot create duplicate filename '/module/aurora/sections/__param' ... mod_sysfs_setup+0x408/0x6d4 ... load_module+0x1bd4/0x2200 The module has two sections named __param. The 22 diagnostic parameters of g18/compat declare their kernel_param entries by hand with a plain used attribute, which is #[used(linker)] on ELF: their section gets SHF_GNU_RETAIN, so the module link keeps it apart from the module's other __param input sections, whose entries (kernel::module!'s, g18_param!'s) are #[used(compiler)]. The import of the backend brought these entries; with G18 off they are not built and the module has one __param section, so the mistake stayed hidden until aurora-silicon#1939 exposed it by turning G18 on. Declare every hand-written __param entry of the backend through one macro, g18_kernel_param!, which emits it the way rust/macros/module.rs does: #[used(compiler)], and a raw address of __this_module instead of a reference to the mutable extern static. g18_param!, the application compute knobs, the two render policy parameters and the 22 compat parameters now go through it; their names, permissions, operations and arguments are unchanged. Built with G18, aurora.ko has one __param section again, and the 23 "creating a shared reference to mutable static" warnings of these entries are gone. Only code built with CONFIG_DRM_ASAHI_G18 changes. Without it none of this is built; with it every board gets a GPU driver that loads, and the G18 boards (T8152) keep the same parameters. Fixes: b2e300a ("drm/asahi: g18: import the G18G (T8152) backend") Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
This was referenced Nov 15, 2026
Open
Merged
DjDeveloperr
approved these changes
Nov 17, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the G18-local parameter-emission refactor with an independent source review. All 22 compat names/ops/permissions/arguments retain their values; the generic, application and render parameters use the same declaration convention. The shared macro follows the kernel's #[used(compiler)] convention and avoids creating a reference to mutable __this_module; no parameter handlers or GPU policy change. Exact-head host CI is green. Author-supplied module/built-in table inspection and J775D module-load/regression rows support the fix at their stated compositions. No new Kbuild/hardware operation or G18 hardware qualification is claimed by this review.
DjDeveloperr
merged commit Nov 17, 2026
f510691
into
aurora-silicon:integration/aurora
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is missing
Since #1939 the shared defaults build the G18 backend (
CONFIG_DRM_ASAHI_G18=y), andaurora.kono longer loads,so no Apple GPU probes on a kernel built from them, whatever the generation. On a Mac Studio (M5 Ultra, J775D) with
integration's head the module load stops at:
and the GPU device stays without a driver: no render node, and the desktop session's dependencies fail.
The module has two sections named
__param(readelf -S aurora.ko):The first holds the 22 diagnostic parameters of
g18/compat(0x370 bytes, 22 entries of 40). They declare theirkernel_paramentries by hand with a plain#[used], which is#[used(linker)]on ELF targets: the section getsSHF_GNU_RETAIN(theR), so the module link keeps it apart from the module's other__paraminput sections, whoseentries (
kernel::module!'s,g18_param!'s) are#[used(compiler)]. Built without G18, the module has one__paramsection: integration's head with G18 off, its parent b9ac02a, and 7c71d6d all do.What this adds
One commit, in the G18 backend only. Every hand-written
__paramentry of the backend now goes through one macro,g18_kernel_param!(g18/params.rs), which emits it the wayrust/macros/module.rsdoes:#[used(compiler)], anda raw address of
__this_moduleinstead of a reference to the mutable extern static.g18_param!, the applicationcompute knobs, the two render policy parameters and the 22 compat parameters use it; their names, permissions,
operations and arguments are unchanged. One definition means a new parameter cannot pick the other attribute again.
A side effect: the 23 "creating a shared reference to mutable static" warnings these entries added to the build
are gone.
Considered and not done: a
__paramrule inscripts/module.lds.Swould merge such sections for every module, butit changes the link of every module on every architecture for a mistake that is local to this backend, and the
in-tree macro already shows the right attribute.
Who runs the changed code
Only code built with
CONFIG_DRM_ASAHI_G18changes. Built without it, none of the changed code is compiled. Builtwith it (integration's defaults since #1939), every board gets a GPU driver that loads again, and the G18 boards
(T8152, J873) keep the same parameters with the same names, permissions and handlers. No other GPU family's code is
touched.
Depends on
Nothing.
Validation
On integration/aurora at 0b03fe4:
and under the M5 Ultra commits, with 0 errors; on fc05050 under the M5 Ultra pull request alone, too.
aurora.kohas one__paramsection of 0x12e8 bytes (121 entries, the 22 compat entries among them), where thehead has two (0x370 and 0xf78).
CONFIG_DRM_ASAHI=y): all 53 G18 parameter entries, the 22 compat ones among them, lie inside vmlinux's__paramtable, so built-in kernels keep the same parameters.from these entries, and the other 14 are unchanged.
scripts/checkpatch.pl --strict: clean.Hardware (Mac Studio, M5 Ultra, J775D)
integration/aurora at 0b03fe4 with integration's configuration and the M5 Ultra commits (then including a
compute-timestamp change that is no longer in this set), one boot each:
46 concurrent clients and a 628-case render CTS subset (571 pass, 57 not supported). All 477 timestamp and
calibration CTS cases of the monolithic pipeline and multiview groups pass or are not supported (54 without a
display). The kernel log shows no GPU recovery, fault or timeout. The light compute rows read as on 7c71d6d
(16.9-17.2 us with 8 computes in flight against 16.7-17.6).
("J775D GPU and CPU clusters" below), integration's configuration, one boot: the GPU probes, and the compute and
chained-submit checks, 46 concurrent clients and the 628-case subset (571 pass, 57 not supported, two runs) pass,
with no GPU recovery, fault or timeout in the kernel log. On another boot of the same kernel, 475 of the 477
timestamp and calibration cases pass or are not supported; the two
timestamp_stagecases fail (on a third boottoo), as they do on the M5 Ultra until dj's Mesa usb: xhci: plat: fix the modpost break in xhci-plat-test (KUNIT_ALL_TESTS=m), add missing KUnit module descriptions #347 (open) is in, which makes them pass on the same kernel.
This commit does not touch that path.
Not tested
tools/asahi/run-host-tests.pydid run, on integration/aurora atfc05050 with this and the M5 Ultra pull request: 321 of 321 pass, as on the head.
Part of the M5 Ultra platform pack
Each pull request below stands on its own; together they bring the Mac Studio (M5 Ultra, J775D) up from public
branches to the desktop.