Skip to content

EDAC: Add Apple SoC platform error reporting - #1040

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
work/conn5-soc-edac
Nov 6, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
work/conn5-soc-edac

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Adds an EDAC driver for the SoC error-handler and event-log-handler interrupt groups on T6041/T6040 (J616s, J614s, J616c). The T8140 (J700) nodes are added disabled until they are qualified on the Neo.

What it does:

  • Registers one EDAC device per handler, named after the device.
  • T6041 NI sources: reads the per-source NI status (25 windows), acknowledges it by writing the observed bits back, and counts an uncorrectable error only for bits in the platform error policy.
  • Other claimed sources: there is no status contract for them. A delivery is counted and logged rate-limited, then the line is masked and unmasked with a 1 s to 60 s backoff. A line still asserted after 8 tries stays masked, reported at info level. Nothing panics.
  • Left unclaimed:
    • DCS lines (they drive a separate DRAM thermal loop).
    • AMCC lines (asserted from boot, and an AP read of their status aperture resets the J616s).
    • NSC/NSI lines (no returning acknowledge path).
  • CONFIG_EDAC_APPLE_SOC=m in defconfig and asahi.config.

Hardware (J616s, fleet17, one-shot aura-try Stage 2 with only these nodes added; evidence in the lane kits):

  • Trial 1, log and mask: all 16 AMCC lines fired from boot and re-fired on every unmask.
  • Trial 2, AMCC unclaimed: ni3 source 63 was asserted from boot and its masking worked.
  • Trial 3, AMCC status reads: the machine reset at module load.
  • Read-only /dev/mem probe: all 25 NI status windows read 0. The first AMCC read reset the machine.
  • Trial 4, this head: 38 error and 21 event-log sources monitored. Over 10 minutes idle and 3 minutes of stress-ng: 0 interrupts, 0 UE, 0 err-level kernel lines, no new warnings, 0 AVC (Enforcing).

Build: W=1 clean for the module and for the J616s, J614s, J616c and J700 DTBs. dt_binding_check and the scoped dtbs_check pass. host-tests pass.

🤖 Generated with Claude Code

Register the T6041 and T8140 platform-error and event-log interrupt groups with EDAC. Report fatal sources as uncorrectable errors before entering the normal panic path, allowing configured pstore backends to retain the report.

Leave the DCS thermal-loop interrupts unclaimed and avoid undocumented register writes.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
No acknowledge contract is established for the error-handler and
event-log status registers, so a source cannot be cleared from Linux.
Panicking on the first delivery would turn any benign or stuck line
into a dead machine.

Count each delivery as an uncorrectable error in the EDAC core, log it
rate-limited, and mask the line. Unmask it again after a backoff that
doubles from 1 s to 60 s; a line still asserted after eight backoffs
stays masked. A quiet minute restarts the backoff.

Move the T8140 nodes to the root: they have no reg, so they do not
belong on the simple bus. Build the driver as a module in defconfig
and enable it in asahi.config.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
A J616s trial boot showed all sixteen AMCC error-handler lines asserted
from boot: each re-asserts as soon as it is unmasked, under idle and
load alike, while no other source fired. Without an acknowledge
contract they cannot be told apart from real errors, so leave them
unclaimed like the DCS lines.

Name each EDAC control after its device: the event-log handler failed
to probe with -EEXIST because both handlers registered "apple_soc".

Measure a line as cleared from its last unmask rather than its last
delivery. With a 60 s backoff ceiling, the old rule reset the retry
count on every unmask and never left a stuck line masked.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware results on the J616s (fleet17 kernel, aura-try one-shot Stage 2 = production c3e88ae5 DTB plus only the two handler nodes; production restored after each run, 0 AVC both times).

Trial 1 (d1f674d, log and mask with backoff):

  • All 16 AMCC lines (sources 10-25) are asserted from boot. Each re-fires on every unmask, idle and under load: 708 UE in 13 minutes.
  • No other source fired.
  • The event-log instance failed to probe with -EEXIST because both handlers registered the same EDAC name.
  • The original panic-on-first-IRQ version would have panicked on every boot.

Trial 2 (2987097: AMCC unclaimed, per-device name, stuck-line rule measured from the unmask):

  • Both instances probe: 57 error sources plus 21 event-log sources.
  • Only ni3 source 63 fired. It was asserted from boot and re-fired at 1, 2, 4 ... 64 s, then stayed masked ("stays asserted").
  • Nothing fired during 10 minutes idle and 3 minutes of stress-ng load.
  • The stuck line still costs 18 err-level boot-log lines.

Not merging yet. The driver cannot tell a line that is asserted from boot from a real error without the status/acknowledge semantics, and the clean boot-log standard rules out the extra err lines. The next step is Daybreak t-5254: read and clear each source's status, and claim AMCC again only once its semantics are known. Then retest on the same Stage 2 recipe.

🤖 Generated with Claude Code

@RyanTheTide
RyanTheTide marked this pull request as draft November 6, 2026 18:21
An asserted error-handler line is not an error by itself. The J616s
hands Linux several lines that are asserted from boot, so log-only
reporting either counted them as errors or masked them with warnings.

Map the four AMCC and 25 NI status apertures. On delivery, read each
source status, acknowledge it by writing the observed bits back, and
count an uncorrectable error only when a bit in the platform error
policy is set. A delivery with no pending status goes through the
existing mask and backoff without being counted.

Reclaim the sixteen AMCC lines, now that they are acknowledged. Leave
the NSC and NSI lines unclaimed: no returning acknowledge path is
established for them.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Trial 3 on the J616s (5e3111b, status read and write-one-to-clear for the AMCC and NI windows, same aura-try one-shot Stage 2 recipe):

  • The trial boot came up with both nodes, including the 29 status windows.
  • The machine reset within seconds of loading the module. The journal ends before the load and nothing persisted, so the cause is not logged. The likely cause is an SError from one of the new MMIO accesses: an unpowered or unclocked aperture, or a wrong window.
  • The machine came back on the production Stage 2 and fleet17 with 0 AVC.

Still a draft. Before this can load: probe the 29 windows read-only one at a time to find the faulting one and its power domain. Then either add the right power-domains or drop that window.

🤖 Generated with Claude Code

On the J616s the first read of an AMCC status aperture from the AP
resets the machine, so the module could not be loaded with them
mapped. The 25 NI status windows read safely and are kept.

Leave the AMCC lines unclaimed again. A line still asserted with no
pending status is not an error: report that it is left masked at info
level.

Keep the T8140 handler nodes disabled until they are qualified on the
J700.

Tested on the J616s with a one-shot trial Stage 2 carrying only these
nodes: 38 error and 21 event-log sources monitored, no interrupt over
10 minutes idle and 3 minutes of stress-ng, 0 UE, 0 err-level kernel
lines, 0 AVC.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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