Skip to content

kernel: retire 0040/0041 — upstream took the userspace fix for the Switch IMU and LED names - #173

Merged
mcfbytes merged 2 commits into
masterfrom
kernel/retire-0040-0041-userspace
Sep 12, 2026
Merged

mcfbytes merged 2 commits into
masterfrom
kernel/retire-0040-0041-userspace

Conversation

@mcfbytes

Copy link
Copy Markdown
Owner

Why

Upstream closed the two kernel PRs we sent for the Switch controller names and took the userspace alternatives instead:

Kernel PR (closed) Maintainer's call Userspace PR (merged)
Linux-Kernel_MiSTer #96 — keep the " IMU" suffix "better to follow mainline to be compatible with upstream kernel source" Main_MiSTer #1307 — also skip "(IMU)"
Linux-Kernel_MiSTer #97 — restore player1..4/home LED names "we will use mainline version to be compatible with further updates" Main_MiSTer #1308 — fall back to :green:player-N / :blue:player-5

Both Main_MiSTer PRs merged 2026-09-12 and are in Release 20260912, so our kernel no longer needs to carry the stock names.

What changes

  • Deleted 0040-hid-nintendo-imu-name-suffix.patch and 0041-hid-nintendo-stock-led-classdev-names.patch from the shared series, plus the beta and DE25 symlinks to them, and their two series entries. Slots left empty (same convention as 0005).
  • Docs/ledgers follow: provenance rows marked RETIRED with the upstream outcome; series header, rt-beta-kernel.md, buildroot-config.md, README and the DE25 series README/audit counts move 40 → 38 shared, 42 → 40 beta entries, 36 → 34 DE25; the two recon records drop the retired file from carried_patches and reduce.py's regenerated outputs are committed; upstream-candidates/README.md records the PR outcomes.
  • Nothing else in the series moves. 0032's :combo node and 0035's non-fatal home-LED registration are unaffected (:combo has no mainline name to fall back to).

Verification

  • Surviving hid-nintendo stack (0015 0032 0034 0035 0038 0039 0049) re-applied with patch -p1 -F0 on pristine 6.18.51 and, via the beta copies, 7.2.5: 7/7 each, zero fuzz; mainline's "%s (IMU)" and LED_FUNCTION_PLAYER5 names are back in both trees.
  • scripts/lint-kernel-patches.sh: PASS, 39 patches in 2 series.
  • python3 docs/kernel-recon/reduce.py: 136 records, 0 problems (no orphans).
  • Beta series: 40 non-comment entries, every one resolves.
  • Reverse-applied 0040/0041 in the existing output/build/linux-6.18.51 and linux-rt-7.2.5 trees: hid-nintendo.c came out byte-identical to the pristine replays above, and hid-nintendo.o cross-compiled W=1 with zero warnings on both (trees restored afterwards).
  • Not done: no full kernel relink or board boot. The removed hunks only renamed strings.
  • Code review (high) ran on the branch; its findings (stale references in 0049's header and three LED-class comments, README count drift, "not sent" wording in the fork-sync/export docs, missing build evidence, user-facing version floor) are folded in.

After checkout

Buildroot never re-patches an already-extracted tree, so a local make would keep the old names: run make linux-dirclean linux-rt-dirclean first. CI is unaffected.

Note for anyone flashing this

Requires Main_MiSTer 20260912 or newer on the card. On an older Main the Switch IMU node is pooled as a phantom controller and the player/home LEDs stay dark — exactly the gap the two patches closed.

Follow-ups (not in this PR)

  1. Bump the sdcard payload pin to release_20260912. release.yml's STOCK_RELEASE_* (mirrored in scripts/fetch-sdcard-payload.sh and docs/ci.md) still stages release_20260907, whose files/MiSTer predates #1307/#1308 — a tag-built sdcard.img would pair this kernel with a Main that only matches the old names. Per docs/renovate.md that pin moves only by a deliberate, reviewed change with its own verification (docs/verification/stock-release-20260907.md §6.2 template), so it is a separate PR. Values already measured for it, from SD-Installer commit cd80db9c0ab64ba38be95071a090a80c367d63cf ("Release 20260912."):

    volumes release_20260912.7z.001 (83,886,080 B) + .002 (42,660,398 B)
    joined size 126,546,478
    joined MD5 7cec2206e2a1133aa307c541219aa08f
    joined SHA-256 35fcbaca57cd2471b1d353f3dd4bae7c7e67256f8c5c8b2d6d5cbcc78269a7ea
    uboot.img / updateboot unchanged (e2d46cf9… / 6ff2d50a… — the STOCK_UBOOT_*/STOCK_UPDATEBOOT_* pins hold)
    files/MiSTer 1,166,224 B, 2026-09-12 build; strings shows (IMU), :green:player-1, :blue:player-5
  2. 0042 (lightbar :red/:green/:blue) and 0037's BTN_Z scoping are the same class of change and were never sent; given this outcome a Main_MiSTer fallback is the likelier route for 0042.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Su9UEMbDZLx5pQRYgQfVuV

mcfbytes and others added 2 commits September 12, 2026 12:27
…witch IMU and LED names

Linux-Kernel_MiSTer PRs #96 (keep the " IMU" suffix) and #97 (restore the
5.15 player/home LED classdev names) were closed by the maintainer in
favour of the Main_MiSTer alternatives offered alongside them: #1307 also
matches "(IMU)", #1308 falls back to ":green:player-1".."-4" and
":blue:player-5". Both merged 2026-09-12 and are in Main_MiSTer Release
20260912, so the kernel no longer needs to carry the stock names.

Delete 0040-hid-nintendo-imu-name-suffix and
0041-hid-nintendo-stock-led-classdev-names from the shared series and the
beta/DE25 symlinks to them; drop the two series entries. 0032's ":combo"
node and 0035's non-fatal registration are unaffected.

Build evidence: the surviving hid-nintendo stack (0015 0032 0034 0035
0038 0039 0049) re-applies at -F0 with zero fuzz on pristine 6.18.51 and,
via the beta copies, 7.2.5, restoring mainline's "%s (IMU)" and
LED_FUNCTION_PLAYER5 names in both; reverse-applying 0040/0041 in the
existing output/build/linux-6.18.51 and linux-rt-7.2.5 trees produced
byte-identical hid-nintendo.c to those replays, and hid-nintendo.o
cross-compiled W=1 with zero warnings on both (trees restored afterwards).
lint-kernel-patches: 39 patches / 2 series PASS. No full kernel relink;
the removed hunks only renamed strings. NOTE for local checkouts: Buildroot
does not re-patch an extracted tree, so run `make linux-dirclean
linux-rt-dirclean` before the next build or the old names stay in.

Docs: provenance rows marked RETIRED (slot left empty, like 0005), with
the SDL2 " IMU" consumer noted as uncovered (stock-identical); series
header, rt-beta-kernel.md, buildroot-config.md, README and the DE25 series
README/audit counts go 40 -> 38 shared, 42 -> 40 beta entries, 36 -> 34
DE25; 0049's header and the three LED-class comments no longer cite the
retired patches; the two recon records drop the retired file from
carried_patches (reduce.py: 136 records, 0 problems; regenerated outputs
committed); STATUS.md D6, fork-sync-2026-09.md, kernel-export.md and
upstream-candidates/README.md record the PR outcomes; README and
docs/user/beta-testing.md state the Main_MiSTer >= 20260912 floor.

Requires Main_MiSTer 20260912 or newer on the card: on an older Main the
Switch IMU node is pooled as a phantom controller and the player/home LEDs
stay dark, exactly the 5.15-parity gap these patches closed. The sdcard
payload pin (release.yml STOCK_RELEASE_*) still stages release_20260907
and needs its own deliberate bump to release_20260912.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Su9UEMbDZLx5pQRYgQfVuV
…with #1307/#1308)

The previous commit retires kernel patches 0040/0041 because Main_MiSTer
#1307/#1308 now handle the Switch IMU/LED names in userspace -- but the
sdcard payload pin (release.yml STOCK_RELEASE_*) still staged
release_20260907, whose files/MiSTer predates those PRs. A tag-built
sdcard.img would have paired the new kernel with a Main that only matches
the old names. Move the pin to release_20260912, the first stock release
that carries them.

New pin (SD-Installer commit cd80db9c0, "Release 20260912."): two volumes
83,886,080 + 42,660,398 B, joined 126,546,478 B, MD5 7cec2206e2a1133a
a307c541219aa08f, SHA-256 35fcbaca57cd2471b1d353f3dd4bae7c7e67256f8c5c8b
2d6d5cbcc78269a7ea. Mirrored into fetch-sdcard-payload.sh's defaults and
verify-stock-payload.sh's example block, per their own "do not let these
drift" rule.

Measured, not assumed: the two joined archives differ in exactly three
members -- files/linux/linux.img and zImage_dtb (ours replace them) and
files/MiSTer (1,162,128 -> 1,166,224 B; strings shows "(IMU)",
":green:player-1", ":blue:player-5"). uboot.img and updateboot are
byte-identical, so STOCK_UBOOT_*/STOCK_UPDATEBOOT_* do not move. Stock's
modules are still 6.18.38-MiSTer; zImage_dtb was rebuilt with kernel PRs
#93/#94/#95/#98 and the image-creator's missing-firmware commits.

Verified locally with the new values: verify-stock-payload.sh fetch-stock
-> verify-stock (size/MD5/SHA-256/CRC) -> extract-stock -> verify-uboot
all PASS, and scripts/fetch-sdcard-payload.sh ran end to end on its new
defaults (stock archive verified, boot files confirmed, update_all.sh and
wifi.sh pins still verify). No Distribution_MiSTer mirror of 20260912
existed yet and its db.json still has "linux": null.

Docs: ci.md stock-payload sourcing, reference-materials.md (new §1 entry,
20260907 demoted to previous), renovate.md's not-managed paragraph,
downloader-contract.md §11.1 dated note, and a short
docs/verification/stock-release-20260912.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Su9UEMbDZLx5pQRYgQfVuV
@mcfbytes

Copy link
Copy Markdown
Owner Author

Local build on this branch (WSL2 workstation, 2026-09-12), after make linux-dirclean linux-rt-dirclean:

  • make all: exit 0. Buildroot applied 78 patches (38 shared on 6.18.51, 40 series entries on RT 7.2.5), zero FAILED hunks, zero fuzz; 0049 landed at the documented -23 offset on 6.18 and -2 on 7.2.5. Both built hid-nintendo.c files carry mainline's "%s (IMU)" / LED_FUNCTION_PLAYER5 and none of the retired strings. Fresh linux.img, zImage_dtb, zImage_dtb-rt; module trees 6.18.51 + 7.2.5; check-linux-img.sh all assertions passed.
  • scripts/ci-tests.sh: PASS (176 ok, 3 skip for the missing stock-binary oracle, 0 fail).
  • make sdcard on the new release_20260912 pin: archive verified (size/MD5/SHA-256/CRC), uboot.img/updateboot byte-identical, staged files/MiSTer is the 1,166,224 B 20260912 build with the (IMU) / :green:player-1 / :blue:player-5 fallbacks; check-sdcard.sh all assertions passed (payload inventory matches sdcard-payload.md, 30 entries).
  • scripts/test-initramfs.sh (6.18.51, default series) and --kernel rt (7.2.5, beta series): 8/8 PASS each under QEMU.

Not done: no boot on the DE10-Nano rig.

@mcfbytes
mcfbytes merged commit 5658ed5 into master Sep 12, 2026
6 checks passed
@mcfbytes
mcfbytes deleted the kernel/retire-0040-0041-userspace branch September 12, 2026 18:52
mcfbytes added a commit that referenced this pull request Sep 16, 2026
kernel: retire 0040/0041 — upstream took the userspace fix for the Switch IMU and LED names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant