Skip to content

fix(wifi): cover BCM4388 in Wi-Fi resume recovery - #465

Open
ansonboby wants to merge 2 commits into
omacom:quattrofrom
ansonboby:fix/wifi-resume-bcm4388
Open

ansonboby wants to merge 2 commits into
omacom:quattrofrom
ansonboby:fix/wifi-resume-bcm4388

Conversation

@ansonboby

Copy link
Copy Markdown

Summary

BCM4388 (14e4:4434) wedges on real lid-close suspend just like BCM4378/BCM4387 — scans fail and every association is rejected until the driver reloads. Adds 4434 to the installer leaf gate and the existing-install migration, which was deliberately excluding it based on a single six-minute s2idle test on an M2 Max (PR #255 review) that did not reproduce the real-world lid-close path.

The recovery command itself is unchanged: it stays a no-op on machines where the firmware does not wedge (wedge signature + backstop + radio-disabled guard).

Test plan

  • Updated test/shell.d/wifi-resume-fix-test.sh: BCM4388 on aarch64 now asserts service install + enable; x86_64 with 4434 still skipped; migration installs for aarch64/4434. All 21 assertions pass.
  • bash -n clean on leaf, migration, command, and test.

Relates to omacom#10857.

BCM4388 (14e4:4434) wedges on real lid-close suspend just like the
other parts. The single s2idle test that excluded it did not
reproduce the real-world path.

Covers omacom#10857.
@malik-na malik-na added the lvl 0 Core userspace: display, audio, video, graphics, memory, storage, battery, keyboard, network, BT. label Sep 18, 2026

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BCM4388 addition is worth taking. omacom#10857 records a real M2 Pro lid-close failure followed by recovery with the existing service. My earlier healthy M2 Max suspend sample was too narrow to justify excluding the whole chip family.

One blocker before merge: this changes an already-published migration rather than adding a new one.

migrations/1787753224.sh previously exited successfully on BCM4388, so omarchy-migrate marked it complete. The runner checks the filename's completion marker, not whether the script has changed. Existing users who processed that migration will therefore never reach the expanded hardware gate. Fresh provisioning also stamps the existing migrations.

I reproduced this with the actual migration runner in an isolated fixture:

  1. Run the previous migration against stubbed aarch64/BCM4388 hardware: it skips the hardware and creates its completion marker.
  2. Replace the migration with this PR's version.
  3. omarchy-migrate --pending reports nothing pending; a normal run skips the repair, leaving the service absent.

Please add a new timestamped, idempotent migration that invokes the updated hardware leaf for affected installations. Add a runner-level regression with the old migration already marked complete and the recovery service absent. The current tests execute the migration directly, so they cannot catch this upgrade path.

Validation at 19b66f9d: all 21 focused Wi-Fi checks passed, and independently reverting either the leaf gate or migration gate made the suite fail. Command metadata and shebang-aware syntax checks passed; all four hosted checks are green. The local full suite had three environment-related failures: launch-about passed without inherited NO_COLOR, plugin-add passed with fixture Git signing disabled, and settings-package-units remained blocked by a local recipe checkout differing from the pinned revision.

One existing limitation, separate from the migration blocker: the helper also reloads after 12 seconds disconnected without a wedge signature, so it is not strictly a no-op on every unaffected machine. Keep the explicit chip allowlist; slow or out-of-range reconnection remains a useful hardware follow-up.

For the upstream distillation, I would carry this chip addition into the add-on's shared wifi-supported predicate and its tests, preserving its service-mask and administrator-override handling.

Review assisted by Codex. No new hardware suspend/recovery validation was performed for this review.

@malik-na malik-na added the OMP label Sep 20, 2026
…d one

omarchy-migrate stamps completion per migration filename, so editing the
already-published 1787753224.sh could never reach machines that ran it:
their marker makes the runner skip the file forever. Restore that file to
its published form and ship the BCM4388 gate as a follow-up migration
(1790008000.sh) with a narrow 14e4:4434 gate and the same idempotence
checks.

Adds the runner-level regression from the omacom#465 review: with the published
migration marked complete and the recovery service absent, the actual
omarchy-migrate still schedules and runs the follow-up, and a completed
upgrade path never re-escalates.
@ansonboby

Copy link
Copy Markdown
Author

Fixed in 0d68c9c — you're right, and thanks for catching the marker semantics before this shipped.

  • migrations/1787753224.sh is restored to its published form.
  • The BCM4388 gate now ships as a follow-up migration, migrations/1790008000.sh: narrow 14e4:4434 gate, same arch gate, same chatty-lspci-safe grep (Follow up to #6559 - update fix-t2.sh and ‎migrations/1785944594.sh to not use grep -q omarchy#6608), same systemctl is-enabled skip. Chips the published migration already covers stay with it, so unaffected machines exit at the lspci gate without ever touching sudo.
  • The runner-level regression lives in wifi-resume-fix-test.sh: a sandbox carries exactly your reproduction — the published migration present with its completion marker stamped, the recovery service absent — and drives the real bin/omarchy-migrate. It asserts --pending lists only 1790008000.sh, a run installs and enables the service, the follow-up gets stamped, and a second run re-escalates nothing.
  • Direct coverage for the follow-up as well: installs + enables on aarch64/4434, no-op when already repaired, skips T2 Intel, and leaves 4425/4433 to the published migration.

All 27 assertions in wifi-resume-fix-test.sh pass, plus the migrate runner suites and the bin/manifest style checks. Chip allowlist and the 12-second disconnected reload kept as discussed.

@ansonboby

Copy link
Copy Markdown
Author

Re-review request — the blocker you found is fixed at 0d68c9c6.

You asked for a new timestamped, idempotent migration calling the updated hardware leaf instead of an edit to the already-published 1787753224.sh, plus a runner-level regression with the old migration already marked complete and the recovery service absent. Both landed:

  • migrations/1787753224.sh restored to its published form, so nobody's completion marker is invalidated;
  • migrations/1790008000.sh added — narrow 14e4:4434 gate, same idempotence checks as before;
  • test/shell.d/wifi-resume-fix-test.sh gained the runner-level case: it drives the real migration runner with the published migration already marked complete, asserts --pending stays empty for it while the follow-up is scheduled and run, and that a completed upgrade path never re-escalates.

Your point that the existing tests execute the migration directly, so they cannot catch the upgrade path, is exactly why that case is written against the runner rather than the script.

Verified on my side: 27/27 in that file pass, and all four hosted checks are green. PR is MERGEABLE with no failing checks — the only thing standing in the way now is your standing CHANGES_REQUESTED from Sep 20, which I can't dismiss myself.

On the two notes you kept separate: I left the 12-second reload alone deliberately, keeping the explicit chip allowlist and treating slow/out-of-range reconnection as its own follow-up as you suggested. And carrying the chip addition into the add-on's shared wifi-supported predicate sounds right for the distillation — say the word if a patch for that would help.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lvl 0 Core userspace: display, audio, video, graphics, memory, storage, battery, keyboard, network, BT. OMP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants