Repository navigation
EDAC: apple_soc_edac: count a wake-latched event-log source after a wake, do not report it - #3659
Conversation
021b01f to
8120a6b
Compare
|
dt-checks fix: the event-log branch of the binding has Hardware, J413 (M2 Air), on a kernel carrying these three commits on top of the T8112 sleep series (#3647 and #3595, plus local drain changes). This is not the exact PR head: sleep is off at
Next: a row on this head stacked on #3647 |
|
|
There was a problem hiding this comment.
Verdict: FINISH, then merge at 8120a6bb
Blockers:
apple_soc_edac_open_wake_windows()(drivers/edac/apple_soc_edac.c:169-176) does not refresharmed_jiffies, so the wake window closes immediately and reports false UEs whenever the system enters deep sleep after > 60 s of uptime:irq_data->armed_jiffiesis initialized once inapple_soc_edac_probe()(L469) and is only updated inapple_soc_edac_rearm()when a masked line is re-enabled after a backoff.- If the machine runs for more than
APPLE_SOC_EDAC_BACKOFF_MAX_MS(60000ms) after boot while source 2 is quiet and then enters deep sleep,apple_soc_edac_resume_noirq()->apple_soc_edac_open_wake_windows()setswake_window = truewhilearmed_jiffiesis still > 60 s stale. - On the first wake-latched assertion after resume,
apple_soc_edac_irq_thread()(L198-203) checkstime_after(jiffies, irq_data->armed_jiffies + msecs_to_jiffies(APPLE_SOC_EDAC_BACKOFF_MAX_MS)), which evaluates totrue, immediately clearswake_window = false, and reports the wake's own assertion (and every subsequent backoff retry) viaedac_device_handle_ue(). edac_test_irq_wake_window()(drivers/edac/apple_soc_edac-test.c:87-88) missed this because it manually assignsctx->irq.armed_jiffies = jiffiesinstead of going throughapple_soc_edac_open_wake_windows()with a stalearmed_jiffies; a fresh-boot J413 test taken within 60 s of boot also avoids hitting the stale threshold.- Fix: Refresh
armed_jiffies = jiffies(and resetretries/backoff_msif already past the quiet window, with matchingWRITE_ONCE/READ_ONCEpairing) inapple_soc_edac_open_wake_windows()(timekeeping_resume()runs insyscore_resume()beforedpm_resume_noirq(), sojiffiesis current), and add a KUnit regression test exercisingapple_soc_edac_open_wake_windows()witharmed_jiffiesolder thanAPPLE_SOC_EDAC_BACKOFF_MAX_MSfollowed byapple_soc_edac_irq_thread().
Checked:
Documentation/devicetree/bindings/edac/apple,soc-error-handler.yaml: addsapple,wake-latched-sources(uint32-array) and lists it in theapple,soc-event-logadditionalProperties: falsebranch; hosteddt-checkspassedSUCCESS.arch/arm64/boot/dts/apple/t8112-peripherals.dtsi: marksapple,wake-latched-sources = <2>onm2_event_log_handler(index 2 =AIC_IRQ 196).drivers/edac/apple_soc_edac.c: probe parsing checksn > 0 && i < n,idx >= hw->num_irqs, and!edac->irqs[idx].sourcebeforeenable_irq();NOIRQ_SYSTEM_SLEEP_PM_OPS+pm_sleep_ptr()wiring is clean.drivers/edac/apple_soc_edac-test.c: existing 3 new cases cover pre-wake UE, in-window counting with fresharmed_jiffies, quiet-period window closure, and selective window opening.- Hardware row: J413 (M2 Air) 3/3 deep sleeps on
8120a6bbstacked on#3647(0UEs vs7UEs control), plus on-device KUnit PASS; after fixingarmed_jiffies, please confirm a wake taken > 60 s after boot also reports0UEs.
Evidence
- Diff:
+139/-3across 5 files, 3 commits (4a5b4b96,4d42872f,8120a6bb), DCO on all 3,MERGEABLEonmain. - Nit (non-blocking): in
edac_test_open_wake_windows()(drivers/edac/apple_soc_edac-test.c:119,132),ctxis unused apart fromKUNIT_EXPECT_NOT_NULL(test, ctx).
There was a problem hiding this comment.
resume_noirq opens wake_window without resetting the quiet-period baseline. armed_jiffies still dates from probe or the last rearm, so after more than a minute of quiet uptime the first wake assertion can close the fresh window and report the false UE. Track the start of the fresh wake window separately from the IRQ backoff bookkeeping and add a resume fixture with an old armed_jiffies.
|
Review fix: resume opened the wake window without refreshing Old head |
8120a6b to
396f5ee
Compare
There was a problem hiding this comment.
Verdict: HOLD at 396f5eeb
Blockers:
- Hosted CI checks on
396f5eebare still queued (dt-checks,host-tests,pr-text,readiness). - Exact-head
396f5eebJ413 hardware row is still pending (as noted in your latest comment; please include a wake after > 60 s of uptime confirmingue_countstays0).
Checked:
- Prior
8120a6bbblocker resolved cleanly:apple_soc_edac_open_wake_windows()(drivers/edac/apple_soc_edac.c:180-187) now refreshesirq_data->armed_jiffies = jiffiesbeforeWRITE_ONCE(irq_data->wake_window, true)for every claimedwake_latchedsource, preventing staleprobe()/rearm()timestamps from closing the wake window on the first post-wake assertion after > 60 s of uptime. edac_test_open_wake_windows()(drivers/edac/apple_soc_edac-test.c:130-134) now initializesirqs[2].armed_jiffiesto10 * APPLE_SOC_EDAC_BACKOFF_MAX_MSin the past and verifies it is refreshed to>= before.- Binding (
apple,soc-error-handler.yaml), T8112 DT (t8112-peripherals.dtsi), probe bounds checks, andNOIRQ_SYSTEM_SLEEP_PM_OPSwiring remain clean (MERGEABLEonmain, DCO on all 3 commits).
Evidence
- Diff:
+151/-3across 5 files, 3 commits (4a5b4b96,cf850a99,396f5eeb), DCO on all 3,MERGEABLEonmain. - Code audit found no remaining blockers; ready to approve once hosted CI completes green and the exact-head
396f5eebJ413 row is posted.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
|
There was a problem hiding this comment.
Verdict: MERGE at 396f5eeb after hosted checks and the T8112 sleep integration.
Checked: Resume resets the baseline for claimed wake-latched sources, and KUnit covers a deliberately aged timestamp. The current EDAC head ran unchanged on the J413 sleep stack. Three deep wakes produced zero UEs, seven expected debug counts, and successful GPU rendering after each wake. The device KUnit run passed and hosted DT checks are green. This clears my source and J413 hold. Keep the hosted host-test result and the sleep-stack dependency in the train.
On some SoCs a wake from system sleep latches an event-log source: the first access to the block after the wake raises its line, and it stays asserted until the next sleep. Add apple,wake-latched-sources, the interrupt indices of such sources, so the driver can tell the wake's own assertion from an error. Signed-off-by: Satya Benson <[email protected]>
…t report it A source listed in apple,wake-latched-sources is raised by every wake from system sleep and stays asserted until the next sleep. Reported as an uncorrectable error, it gives one to five false UEs per wake while the line is masked and unmasked on its backoff. Each wake opens a window for those sources, from resume_noirq, before the lines are unmasked again. Inside it, an assertion is counted and logged at debug, with no UE report, and the line keeps its mask and backoff. A line that stayed quiet for a minute after its last unmask had cleared: when it fires again the window closes and it reports as usual. Outside a window, and on every other source, nothing changes. Signed-off-by: Satya Benson <[email protected]>
…-latched On T8112 the first access to the PMGR clock-mux block after a wake from deep sleep raises event-log source 2, and it stays asserted until the next sleep. Signed-off-by: Satya Benson <[email protected]>
396f5ee to
7cee228
Compare
|
Rebased onto current Old head |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 7cee228f
Blockers: none.
Checked: only sources listed in apple,wake-latched-sources and claimed by a handler get a window, so every other source and every other SoC report as before. A wake resets each window's start, so a quiet minute before the sleep can't close it early, and the new KUnit case covers an aged timestamp. A line that fires again after a quiet minute closes the window and reports. The DT value is your own J413 measurement, and there's no chip check. The J413 row at 396f5eeb (same patch-ids) shows ue_count 0 over three deep wakes with source 2 counted at debug. CI is green.
Note (not blocking)
resume_noirq also runs after an s2idle wake, so source 2 is counted rather than reported for a minute after every s2idle resume too. That's fine for a line that only latches, but worth one line in the binding text.
|
No row from T6050 (J775c): |
What: stop reporting the event-log source that every wake from system sleep latches as an uncorrectable error, while still reporting it outside the wake.
The problem: on T8112, the first access to the PMGR clock-mux block after a wake from deep sleep raises event-log source 2. The line then stays asserted until the next sleep.
apple_soc_edachas no status or acknowledge for that source, so it masks and unmasks the line on its backoff. Each wake therefore logs 1–5 UEs that aren't errors. The analysis is in #3371.Changes:
apple,wake-latched-sourceslists the interrupt indices of such sources.resume_noirq, before the lines are unmasked again. The window is timed from the wake, not from the line's last unmask before the sleep.Tested: Current head
7cee228f4ea1is the same code rebased ontomain(from396f5eebaa7b).checkpatch --strict: 0/0/0.396f5eebaa7b(applied unchanged on soc: apple: sleep: T8112 (M2) suspend-to-RAM, enabled on J413 #3647ec5d52890140; sleep is off on T8112 atmain): PASS, 3/3 deep wakes withue_count0, source 2 counted at debug, GPU renders after every wake, KUnit suite ok on the device. Without this PR the same kernel reported 7 UEs over three wakes.Risk: two-way door. It only changes reporting for sources listed in the DT, which today is T8112 source 2.