Skip to content

proxy_fallback: a plain boot that stops in the proxy restarts unless a host attaches - #547

Merged
RyanTheTide merged 3 commits into
mainfrom
reboot-hang/proxy-boot-wdt
Nov 28, 2026
Merged

RyanTheTide merged 3 commits into
mainfrom
reboot-hang/proxy-boot-wdt

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem. A Stage 2 that can't start its payload stops in the USB proxy with no watchdog running, so the Mac stays dark until someone holds the power button or sends a USB-C VDM reset. Stage 1 has a 178 s boot watchdog for exactly this case ("Without a host, this Mac restarts by itself..."), but a Stage 2 disarms it at its start (wdt_disable()), and nothing arms one again until Linux. On the M4 MacBook Air (J713, macOS 27.2) this shows up as an intermittent hang on reboot. Linux shuts down normally and the SoC resets. Then the Stage 2 can't start ANS from off (ANS didn't start from off; it stays down until a reboot), finds no payload, and parks in the proxy: 5 times on 11-27/28 across three kernels, and 1 in 8 plain warm boots in today's row. Linux's 1-minute watchdog can't help, because the boot it guarded is already gone. A later boot brings ANS up.

Change. proxy_fallback(): before a plain boot (not aura-try, not a debug boot) stops in the proxy, arm the boot watchdog again with Stage 1's period, unless one is already running or a host has already attached. The panel says so. The first proxy request from a host turns it off, as in Stage 1 (wdt_host_attached() now also records that a host attached), so a debugging session is never reset under it. Without a host the Mac restarts and the next boot tries again. Trials keep their bounded window and reboot as before (#478). The normal path is unchanged: nothing runs unless the boot was going to stop in the proxy anyway.

Retry policy (review: no finite bound). A plain boot whose failure repeats restarts every 178 s until a host or the owner stops it. That is the policy Stage 1 already ships for its own stop (21d5d47: "Without a host, this Mac restarts by itself within 178 s to try again", no count), and enforcing secure-boot builds of both stages already reboot at once, with no count, instead of opening a proxy. No approved mechanism gives Stage 2 a count that survives the reset on the recorded failure: the failure is storage itself (ANS down until a reboot, so no ESP marker can be written or read), and the deployed Stage 1 clears iBoot's failed-boot count before Stage 2 runs and does not forward it (on the J713, Stage 1 logs panic counter ... was 1, cleared after each self-restart). A bounded count needs a Stage 1 that forwards it (#480) or the Stage 1 NVMe shutdown (#432); this PR adds neither. The disposition of the unbounded case is the boot owner's call, asked for below. Operator recovery path, now on the panel: a host's proxy request within the 178 s stops the restarts (WDT: host attached, boot watchdog off, shown on the exact head below), or hold the power button to shut down and hold it again to choose another system.

Testing (exact head d429933, J713 M4 Air, macOS 27.2). Image = aura d429933 (make BUILDSTD=1 RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1 USE_CLANG=1) + fleet85 DTB + U-Boot 5445237f, the production Stage 2 layout.

  • aura-try of that image: boots Linux in 36 s.
  • Committed as aura/stage2.bin (original kept as .prev), 10 plain warm reboots out of fleet85: 8 normal (30-33 s to SSH). Cycles 9 and 10 hit the natural strand: the Mac parked in aura uartproxy 1.0.0b17-gd429933d at +90-95 s, then restarted by itself and was back on its own (225 s and about 208 s), no VDM. After cycle 9 Stage 1 logs panic counter at /arm-io/nub-spmi0:0e reg f802 was 1, cleared. Then restored to 5ddde9f6.
  • Forced plain-boot stop (the exact head plus one test-only line, aura_trial_enabled() returning false, run as a one-shot with no payload): proxy at +12 s, reset by itself at +183/+184/+186/+189 s, back on production at +212-215 s (4 runs).
  • Same with a host: J616s attaches as soon as the proxy enumerates: WDT: host attached, boot watchdog off. That host's next action decides what follows; there is no watchdog reset under it.
  • A persistent failure is that row on every boot. It was not run as a committed no-payload image: the J713's deployed Stage 1 opens no USB window after a watchdog restart, and chainloading a composed Stage 2 over the Stage 2 proxy did not reach Linux, so the only way back would have been the power button at the Mac.
  • Host: test_proxy_fallback.py 22/22.
  • J473 M2 Mac mini (T8112, legacy WD1) at exact head d429933 (Stage 2 = aura d429933 + the J473 live DTB and U-Boot, same layout): 5/5 aura-try boots came back to Linux in 36-56 s on 1.0.0b17-gd429933d. A host-less forced stop (d429933 + a test-only no-payload change) restarted the Mac by itself at +238 s, with no tether reset.
  • Earlier rows at 0ec6b94's diff on production bases: J473 forced host-less stop back by itself in 227 s; J713 with a host, no reset through +421 s; J713 40/40 committed plain warm reboots.
  • CI: stage1-size (gcc/fedora/nix) fails the same way on main 26c1a85 (headroom 3696/4008/3152 B, below 4096); this PR does not change Stage 1's text room.

Tested: J713 M4 Air (27.2) at exact head d429933: two natural ANS strands in 10 committed plain warm reboots each restarted themselves (no VDM), 8/10 normal; forced host-less stop resets at +183-189 s (4 runs); host attach turns the boot watchdog off. J473 M2 Mac mini (T8112, legacy WD1) at exact head d429933: 5/5 trial boots normal, forced host-less stop self-restart at +238 s (earlier 227 s at 0ec6b94's diff)
Risk: two-way · all Macs, only on a plain boot that was going to stop in the proxy; a failure that repeats on every boot restarts every 178 s until a host or the power button stops it (same as Stage 1)

Related. #503 (draft) changes the same function for an explicit m1n1.wdt=keep boot argument (a non-aura first stage with A/B slots). Whichever lands second rebases: with the token that behaviour applies, and without it this one does. #449 (ANS restart ladder) helps T6040 but did not recover the J713 case (details below). #480 (bounded reboot) needs a new Stage 1. This change needs none.

Still to run. Boot owner disposition of the unbounded restart for a failure that repeats on every boot (or a Stage 1 rev for a bounded count).

Evidence and details
  • Per-incident evidence: the J616s host-side USB log shows the J713 port drop about 4 s after systemctl reboot, then aura uartproxy 1.0.0b15 until the VDM. Stage 2 console read over the parked proxy: traces/boot/20261126-j713-reboot-hang/proxy-probe-213447.log (HELLO, no IOP power report, CPU status 0x6e) and traces/boot/20261128-reboot-hang/j713-plain-dtp2-8db4198d/c8-proxy-probe.log (no HELLO, entry CSTS=0x2).
  • Why aura-try loops never show it: a trial boot's Stage 1 spends the marker (ESP write + flush), which makes it shut the NVMe controller down before it powers ANS off. A plain boot only reads and skips that (nvme: post-M4: shut the controller down normally before ANS goes off #432 is the Stage 1 change). 45/45 trial boots were clean, against 1 in 8 plain boots.
  • Restarting ANS from Stage 2 (nvme: post-M4: start ANS again from a reset when its start from off fails #449's reset/cold/power-cycle ladder) did not recover the CSTS=0x2 case on J713 (ladder fully run, never a HELLO). Only a new boot did, so the Stage 2 has to restart.
  • Row build: J713 production Stage 2 5ddde9f6 = aura 4906f86 (rebuilt byte-identical) + fleet85 DTB + U-Boot 5445237f. The row image differs only by this commit's src diff, committed with the original kept as .prev.

…a host attaches

Stage 1 runs a boot watchdog so that a stop with no host (a read that
fails, a proxy with nobody on it) restarts the Mac instead of staying on
screen. A Stage 2 disarms it at its start, and nothing armed one again
until Linux. A Stage 2 that could not start its payload therefore stayed
in the USB proxy until someone held the power button or sent a USB-C VDM
reset.

On the M4 MacBook Air (J713, macOS 27.2 firmware) that happens on about
one warm boot in eight: the Stage 2 can't start ANS from off ('ANS
didn't start from off; it stays down until a reboot'), finds no payload
and parks in the proxy. The Mac looked hung after a normal Linux reboot,
and Linux's watchdog can't help there: the SoC had already reset. A
later boot brings ANS up.

Before a plain (not aura-try, not debug) boot stops in the proxy, arm
the boot watchdog again with Stage 1's period, unless one is running or
a host has already attached, and say so on the panel. The first proxy
request from a host turns it off, as in Stage 1 (wdt_host_attached(),
which now also records that a host attached), so a debugging session is
never reset under it. Without a host the Mac restarts and the next boot
tries again. Trials keep their bounded host window and reboot.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 27, 2026 18:37
@RyanTheTide
RyanTheTide requested review from a team as code owners November 27, 2026 18:37

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at 0ec6b94751cae2dd38c8ccd16810ac5a43931baa

Blockers:
none in the code. Before merge, the gate still needs: (1) CI green at this head (at the time of review 17 jobs were queued and 7 older runs cancelled); (2) a hardware row on an image built from this exact head. The rows in the body ran this diff on top of the production bases (4906f86 / b17), not on 0ec6b94 itself. See "Rows needed".

Checked:

  • Read the whole diff plus every caller. The new arm only runs inside proxy_fallback() on a non-trial path, and every such path ends in uartproxy_run(NULL) (main.c:304/320, 501/502, 522/523). No route leads from there to a next stage without a host request, and uartproxy_run() calls wdt_host_attached() on every checksummed request before it dispatches it (uartproxy.c:326). So chainload, upload, bulk reads and P_WDT_ARM all run with the boot watchdog already off. A host-armed watchdog (P_WDT_ARM) is not disarmed later, because wdt_boot_armed is already false.
  • Hand-off: Stage 1 (CHAINLOADING && !ESP_STAGE2) has wdt_boot_armed set from start, so the new branch returns early and Stage 1 behaves as before. A Stage 2 that hands off normally never reaches the arm. The NVMe/display handoff-failure stops arm only if no host has synced in this stage (wdt_host_seen), which is what the new flag is for. I found no stage1 -> stage2 -> kernel path where a running watchdog is inherited mid-boot.
  • Period and units: WDT_BOOT_SECONDS 178 s, the same as Stage 1. 178 * 24 MHz = 4.272e9 fits in u32. wdt_arm() bounds it to 1..178.
  • Other watchdog blocks: wdt_arm() picks the channel from the ADT (WD2 + simple-reconfig on wdt-version >= 3 with reg[3]; WD1 RESET_EN on version 2) and refuses any other layout or an armed secondary. Then the new code prints "no boot watchdog, staying in the proxy" and behaves as before. The diff adds no chip-id gate.
  • T8140: usb_cdc_arm_watchdog() (170 s) can overwrite the boot watchdog during the USB bring-up that follows. It is only disarmed when a CDC primary opens or a host request arrives, so the Mac still resets without a host. Not a problem.
  • iBoot failed-boot count: every aura stage clears it (pmu_clear_panic_counter()), so each wdt restart leaves a count of 1. Stage 1 reads that before it clears and opens its 10 s recovery window. On Macs whose ADT has info-leg_scrpad the loop never escalates to recoveryOS. On one without it, the count would accumulate and iBoot would eventually go to recoveryOS, which seems acceptable.
  • Built at head with clang + BUILDSTD=1: Stage 1 (RELEASE CHAINLOADING) and Stage 2 (+ESP_STAGE2) build with no new warnings, and the Stage 2 aura.bin is the same size as main.
  • make format-check with clang-format 20.1.8 is clean.
  • Full pytest (tests/python + t8122): 1255 passed, 27 skipped, 2 failed. The 2 failures are test_loadobjs nm-output fixtures, which fail the same way on main with this machine's binutils, so they are unrelated.
  • New tests against the old src/: 3 fail (arms, arm-fails, host-marked-first) and 17 pass, as the body says.

Non-blocking notes:

  1. There is no retry bound: a persistent failure (missing payload, dead disk) restarts every ~3.5 min forever. This matches Stage 1's existing boot-watchdog behaviour, and each cycle gives Stage 1's recovery window a chance, so I don't consider it a blocker. If a bound is wanted later, it has to come from Stage 1's pre-clear count (the #401/#480 approach), not from a Stage 2 read.
  2. A Stage 2 that a developer chainloads over a Stage 1 proxy session starts with wdt_host_seen false. If it then stops in the proxy, the host has 178 s to send a request. Use an aura-debug boot for long hands-off sessions. Worth a line in the docs.
  3. test_plain_boot_never_arms_under_a_host_or_on_a_debug_boot also passes on the old code (it guards against a regression; it does not prove the fix). test_a_host_marks_itself_before_the_boot_watchdog_check is a source-order text check.
  4. Overlaps #503 textually: whichever lands second rebases, as the body says.

Rows needed (exact head 0ec6b94 built into the row image, same production DTB/U-Boot):

  • J713 (T8132, WD2/simple-reconfig): forced host-less proxy stop, which must restart by itself within ~185 s; the same stop with a host request, which must log WDT: host attached, boot watchdog off with no reset through > 178 s; plus a short plain warm-reboot loop (normal path unchanged).
  • Another generation on the WD1 RESET_EN path, e.g. J473 (T8112) or M1 Pro (T6000): the same forced host-less stop restarts and returns to the production entry, and a host-attached stop does not.
Evidence
  • Head 0ec6b94, base main 26c1a85, not a draft, mergeable.
  • Build: make -j12 USE_CLANG=1 RELEASE=1 CHAINLOADING=1 BUILTIN_LOGO=aurora BUILDSTD=1 [ESP_STAGE2=1] gives s1=0, s2=0; Stage 2 aura.bin is 3997696 bytes at head and on main.
  • pytest 9.1.1 + requirements.txt: 2 failed, 1255 passed, 27 skipped; on main, test_loadobjs.py gives 2 failed, 2 passed.
  • Old src + new test file: 3 failed, 17 passed.

Review follow-ups:

- A BRINGUP build never hands off and stays in the proxy by design, so it
  does not arm the boot watchdog there.
- On T8140 the CDC transition arms the same hardware watchdog for its
  own period after the fallback armed the boot watchdog. A host request
  over DockChannel before the transition then turned the CDC watchdog
  off through wdt_host_attached(). Any watchdog armed through
  wdt_arm_seconds() (the CDC transition, a host's P_WDT_ARM) now takes
  over from the boot watchdog, so a later host no longer turns it off.
- Say plainly that a host which holds the port open but sends no proxy
  request is reset like an absent one.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Independent adversarial review (fresh reviewer, code only): no blocking issues. Findings and what changed in b1c638c:

  1. T8140: the CDC transition re-arms the same hardware watchdog (170 s) after the fallback has armed the boot watchdog. A DockChannel host request before the transition then turned the CDC watchdog off through wdt_host_attached(). Fixed: a watchdog armed through wdt_arm_seconds() (the CDC transition, a host's P_WDT_ARM) now takes over from the boot watchdog. New host test test_another_watchdog_takes_over_from_the_boot_watchdog; it fails on 0ec6b94.
  2. BRINGUP builds never hand off, so they would have restarted every 178 s. Fixed: BRINGUP keeps the proxy (#ifndef BRINGUP; new test). Stage 1, Stage 2 and BRINGUP builds all compile.
  3. "Never reset under a host" was overstated: a host that holds the port open but sends no request is reset like an absent one. Wording fixed in the comment.
  4. wdt: leave an armed watchdog as found under m1n1.wdt=keep #503 overlaps textually: whichever lands second keeps the m1n1.wdt=keep check ahead of this block.

The hardware rows stand. The follow-up changes nothing on the J713/J473 paths: no wdt_arm_seconds() there, and the builds are not BRINGUP. Host suite at b1c638c: 1259 passed, 27 skipped, 0 failed.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge.

Blocker: A plain boot with a persistently unavailable payload can rearm the watchdog on every restart. Please provide a finite retry policy using an approved existing mechanism, or obtain the boot owner's explicit disposition of recurring resets before enabling this production fallback. Include an operator recovery path and exact-head hardware evidence that covers a persistent failure as well as a transient failure.

Checked: The BRINGUP path leaves the proxy up. Successful CDC watchdog takeover clears the boot ownership flag, so a later host attach leaves the replacement timer alone. The independent host replay observed one arm per fresh process with a persistent failure and no arms on the host, debug and BRINGUP controls. The hardware row in the PR body cites the prior diff.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verdict: MERGE at b1c638c6 once CI is green

Blockers: none

Checked (delta 0ec6b947..b1c638c6):

  • proxy_fallback(): the boot-watchdog arm is now under #ifndef BRINGUP. BRINGUP builds never hand off, so they keep the plain proxy. Production Stage 1/2 builds are not BRINGUP, so their path is unchanged.
  • wdt_arm_seconds() clears wdt_boot_armed once it successfully arms another period. The CDC transition watchdog on T8140, or a host's P_WDT_ARM, takes over, and a later host request no longer turns off a watchdog it didn't arm. New host test test_another_watchdog_takes_over_from_the_boot_watchdog.
  • The comment no longer overstates "never reset under a host": a host that holds the port but sends nothing is reset.
  • Rows: the J713 + J473 host-less restart rows ran at 0ec6b947. They still cover this head for those Macs: neither calls wdt_arm_seconds() on that path and neither runs a BRINGUP build, so their behaviour is identical by construction.

@github-actions github-actions Bot added blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at d429933d: not ready yet

Check Detail
CI at head no failing: gcc, pr-text / pr-text, fedora, nix
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at d429933d
Conflicts ok none
PR text ok Risk: two-way · all Macs, only on a plain boot that was going to stop in the proxy; a failure that repeats on every boot restarts every 178 s until a host or the power button stops it (same as Stage 1) Related. #503 (draft) changes the same function for an explicit m1n1.wdt=keep boot argument (a non-aura first stage with A/B slots). Whichever lands second rebases: with the token that behaviour applies, and without it this one does. #449 (ANS restart ladder) helps T6040 but did not recover the J713 case (details below). #480 (bounded reboot) needs a new Stage 1. This change needs none. Still to run. Boot owner disposition of the unbounded restart for a failure that repeats on every boot (or a Stage 1 rev for a bounded count).

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 27, 2026
@RyanTheTide
RyanTheTide disabled auto-merge November 27, 2026 20:43
A plain boot whose payload fails the same way every time restarts every
178 s, as Stage 1's own stop does: no count survives the reset for
Stage 2 to read, since the failed storage holds none and Stage 1 clears
iBoot's failed-boot count before Stage 2 runs. Say on the panel that a
host's proxy request stops the restarts and that the power button
chooses another system.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at d429933d98ce.
Blocker: The new panel message explains how to interrupt recurring resets. The fallback still re-arms on every boot with a persistently unavailable payload. Please limit automatic retries or record the boot owner’s explicit acceptance of recurring resets, then attach the current-commit hardware result.
Checked: The delta changes the recovery instructions. Host and power-button recovery are now documented, while watchdog arming and the cross-boot behavior are unchanged. Hosted checks were queued at review.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 27, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Reply to the CHANGES_REQUESTED review (finite retry policy, operator recovery path, exact-head evidence), now at d429933:

  • Finite retry policy. Stage 2 has no approved mechanism for a count that survives the reset on the failure this fixes. Storage is the thing that failed (ANS stays down until a reboot), so no ESP marker can be written or read. The deployed Stage 1 clears iBoot's failed-boot count before Stage 2 runs and does not forward it (J713 Stage 1 after a self-restart: panic counter ... was 1, cleared). payload: reboot, bounded, when a Stage 2 can't start ANS from off #480 shows that a bounded count needs a Stage 1 change. The unbounded 178 s restart is the policy Stage 1 already ships for its own stop (21d5d47), and enforcing secure-boot builds of both stages already reboot with no count. I've asked the boot owner for an explicit disposition. The PR body says this under "Retry policy" and "Still to run".
  • Operator recovery path. d429933 puts it on the panel: a host's proxy request within 178 s stops the restarts; otherwise hold the power button to shut down, then hold it again to choose another system. Verified on the exact head: WDT: host attached, boot watchdog off.
  • Exact-head hardware. J713 production-layout image built from d429933, committed: 10 plain warm reboots, 8 normal, 2 natural ANS strands that each parked in the proxy and restarted themselves (back in 225 s and about 208 s, no VDM). Forced host-less stop: self-reset at +183 to +189 s in 4 runs. Persistent (every-boot) failure was not run committed on the J713: its Stage 1 opens no USB window after a watchdog restart, and chainloading a composed Stage 2 over the Stage 2 proxy did not reach Linux, so recovery would have needed someone at the Mac. Evidence: traces/boot/20261128-reboot-hang/j713-*-d429933d* (lab store).
  • CI. stage1-size gcc/fedora/nix fail identically on main 26c1a85 (Stage 1 headroom below 4096 B). Not touched by this PR.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at d429933d98ce once the three gates below are cleared. The code has no blockers.

Blockers: none in the code. Gates that aren't mine to clear:

  1. The open CHANGES_REQUESTED (recurring resets on a payload that fails every boot) needs the boot owner's decision recorded on this PR. My read, for that decision: the unbounded 178 s restart is the policy Stage 1 already ships for its own stop (21d5d47), and Stage 1 clears iBoot's failed-boot count, so a bounded count needs a Stage 1 change (#480), not this PR. Before, the Mac sat in the proxy until someone acted; after, it still needs someone for a permanent failure (host request or power button, now on the panel), and it recovers by itself from the transient ANS strand this targets. So I see no added harm. It is still a policy call for ORCH5/Ryan, not for a reviewer.
  2. stage1-size (gcc/fedora/nix) is red, identically on main 26c1a85b (REVIEW6 compared them). It needs a landing decision, not a fix here.
  3. @DjDeveloperr code-owner ping (aura): no objection by an hour from now and the window is done.

Checked: read the whole diff and every caller: proxy_fallback() from main.c (no payload, NVMe and display handoff failures), and wdt_host_attached() from the three proxy request paths in uartproxy.c. The arm runs only on the non-trial path; debug boots, BRINGUP builds, a running boot watchdog and an earlier host all skip it; a failed arm keeps the old proxy stop. wdt_arm_seconds() hands ownership to any other watchdog (T8140 CDC transition, P_WDT_ARM), so a later host can't turn off a watchdog it didn't arm. Host tests: test_proxy_fallback.py 22/22 at this head; the same file against main fails 5 (the new cases), so the tests detect the change. The exact-head J713 row (production-layout image from d429933d): 10 warm reboots, 2 natural ANS strands each self-restarted (225 s, about 208 s, no VDM), forced host-less stop resets at +183 to +189 s (4/4), and a host request turns the boot watchdog off. No attribution.

Before rollout (FLEET-EDGE): a normal boot of this Stage 2 on a second family (J473) to show the healthy path is untouched; the code only runs on a stop, but the image changes on every Mac that gets it.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 27, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at d429933d98ce. Same verdict as my 09:15 review, now as an approval so point 1 holds; the full adversarial checks are in that review.

Blockers: none in the code.

Checked: whole diff and every caller; skip conditions (trial, debug, BRINGUP, running boot watchdog, earlier host); a failed arm keeps the old proxy stop; watchdog ownership hand-off to the CDC/P_WDT_ARM period; host tests 22/22 at this head (5 fail on main); exact-head J713 row (2 natural ANS strands self-restarted, forced host-less stops reset at +183 to +189 s, host request disarms). No attribution.

Merge still needs, and they are not mine to clear: (1) the boot owner's recorded yes to the recurring 178 s restarts on a payload that fails every boot, so REVIEW6's CHANGES_REQUESTED can be lifted (6-point item 5); (2) a landing decision on stage1-size (gcc/fedora/nix), which fails identically on main 26c1a85b. Dj's code-owner window closed 10:15 with no objection. Before FLEET-EDGE rolls it out: a normal J473 boot of this Stage 2.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr (code owner, aura): heads-up before a merge under the org's 6-point rule (an App approval can't satisfy the code-owner rule, so an admin merge happens only when all six hold at the exact head). Please object here if you want changes. A blocking review from you stops it.

State at d429933d:

  1. Adversarial App review APPROVED at this head (review 6094327167), from a different lane than the author.
  2. CI: everything passes except stage1-size gcc/fedora/nix. That check fails on main too, with identical numbers. Main 6e796e02 push run 46072257279 gives gcc 3696 B, fedora 4008 B, nix 3152 B against the 4096 B floor. This head (run 46070314131) gives the same text room for each flavour. proxy_fallback: a plain boot that stops in the proxy restarts unless a host attaches #547 changes only the Stage 2 proxy fallback and doesn't move Stage 1 room. Main needs a separate Stage 1 size fix (build: pack the relative relocations as RELR #488, RELR, would free ~64 KiB).
  3. Hardware at this head (J713, T8132): 10 committed plain warm reboots. 8 came back normally and 2 hit natural ANS strands that restarted themselves (225 s and ~208 s) with no tether reset. Forced host-less proxy stops restarted at +183-189 s (x4). After a host request it logged 'boot watchdog off' and did not reset.
  4. Second family (J473, T8112 legacy WD1): an exact-head row is queued for the next J473 window. Earlier row at the same diff: self-restart in 227 s.

What the change does: a plain boot that stops in the Stage 2 proxy re-arms the boot watchdog Stage 1 already armed for this case (Stage 2's start had dropped it). A host proxy request turns it off. With no host attached, the Mac restarts by itself instead of sitting in the proxy forever. This was the "hang on reboot, the watchdog never fires" seen on J713/J473.

Revert: git revert -m 1 <merge>. That restores the old behaviour, where a host-less stop stays in the proxy until someone resets the Mac.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging under the 6-point rule at d429933d. (1) App APPROVED at this head, from a lane other than the author. (2) CI: green except stage1-size gcc/fedora/nix, which fails identically on main 6e796e0 (see the comment above). (3) J713 rows at this head. (4) J473 (T8112) second family at this head. (5) No open blocking review. (6) Code owner pinged at 00:01Z, more than 1 h ago, with no objection. Revert: git revert -m 1 <merge> restores the old host-less proxy stop with no watchdog.

@RyanTheTide
RyanTheTide merged commit 76d2f9a into main Nov 28, 2026
20 of 26 checks passed
@RyanTheTide
RyanTheTide deleted the reboot-hang/proxy-boot-wdt branch November 28, 2026 01:06
AxxzyWasTaken pushed a commit to AxxzyWasTaken/aura that referenced this pull request Nov 28, 2026
Stage 1 arms its boot watchdog on a plain boot so a stop restarts the
Mac, but an ESP Stage 2 disarms it at its start and nothing re-arms one
until U-Boot. aurora-silicon#547 re-arms it when Stage 2 stops in the proxy. A stop
anywhere else in Stage 2 (storage, display or payload steps that never
return) still waits for the power button: a J473 warm-reboot row on
b17 + aurora-silicon#547 hung once in 9 boots with no Linux journal and no restart
within 420 s, after the reset and before the hand-off.

On a plain boot that is not a debug boot or a BRINGUP build, an ESP
Stage 2 now arms the boot watchdog with a fresh period right after it
disarms iBoot's, and disarms it again just before it vectors to the next
stage. U-Boot then starts its own watchdog as before, and U-Boot and
GRUB menus that wait for a person are not reset. The first host request
still turns it off. proxy_fallback() keeps a running boot watchdog in an
ESP Stage 2 and shows the restart text on the panel. Stage 1 behaviour
is unchanged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide pushed a commit to axboe/aura that referenced this pull request Nov 29, 2026
Stage 1's .init and .text share one read-execute segment that ends on a
64 KiB step. aurora-silicon#547 and aurora-silicon#548 grew .text past what that step had left on
three of the toolchains stage1-size checks (text room gcc 3,696 B,
nix 3,152 B, fedora 4,008 B, floor 4,096 B); one more step would move
.data past _file_limit. The lab dev-audit flavour already did not link.

hv_vm.o, hv_virtio.o, hv_vuart.o and hv_wdt.o only run when aura hosts
a guest. Link them beside the sptm_virt objects in the executable
read-only region ([_base, _rodata_end) is mapped RX, memory.c), which
has room to spare. Only the placement changes: the code, its mapping and
the DCP log buffer assertion are the same.

With Arch clang (USE_CLANG=1 BUILDSTD=1), text room in the default
Stage 1 goes from 8,624 B to 20,912 B and rodata room from 30,280 B to
17,936 B; headroom is now the data room, 12,272 B. stage1-dev-audit
links again (3,280 B). The secure flavours and the SPTM_VIRT ESP Stage 2
keep their room.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:none Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant