Repository navigation
Conversation
Document the optional apple,event-logs property describing per-source event-log status words from the ADT event-logs property as <interrupt-index reg-index offset> triples. Signed-off-by: Satya Benson <satya@benson.earth>
…tus words Parse the optional apple,event-logs property (<interrupt-index reg-index offset> triples) during probe, mapping each referenced reg aperture once without claiming an exclusive memory region (event-log apertures span shared SoC blocks whose sub-ranges are claimed by other drivers) while honoring nonposted-mmio. When a configured event-log line fires, read all of its status words, log any non-zero words, and acknowledge them by writing the observed bits back. If every set word reads back clear, return IRQ_HANDLED without masking the line; if any word stays set or no status word is set, fall through to the existing mask-and-backoff path so sticky lines cannot storm. Wake-latched sources inside their post-wake window keep counting at debug with no UE report, stay unmasked if the acknowledge clears them, and avoid double-counting if a sticky word falls through to backoff. Add six KUnit cases covering multi-word read/ack, empty and sticky status words, normal IRQ handling, and wake-window interaction. Signed-off-by: Satya Benson <satya@benson.earth>
Populate apple,event-logs on m2_event_log_handler from the T8112 ADT /arm-io/event-log-handler event-logs table (18 <line reg offset> triples across the 16 event-log interrupt lines, including source 2 at reg 2 +0x28000 and +0x6c004). Keep apple,wake-latched-sources = <2> until live deep-wake testing confirms whether source 2 clears on acknowledge or stays latched until power-off. Signed-off-by: Satya Benson <satya@benson.earth>
|
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 5e4086d
Checked:
- DT: each of the 18
<line reg offset>triples lies inside itsregwindow inm2_event_log_handler(e.g. reg 2 is 0x70000 long, so+0x28000and+0x6c004fit; regs 4–10 are 0x4000 long, so+0x3ff0fits; regs 14/15 are 0xc000 long, so+0x400cfits). All offsets are 4-aligned, so probe's own bounds/alignment checks pass on T8112. Nodes withoutapple,event-logsreturn 0 from the parse with no other change. - IRQ thread: a set word that clears on W1C returns
IRQ_HANDLEDunmasked. If the line is still asserted for an undescribed reason, the next invocation reads all words zero and falls to mask + backoff, so it can't storm beyond one extra round. A sticky word (source 2 on wake, as your J413 deep rows show) reaches the existing backoff withreportedset, so the UE isn't double-counted and the wake count isn't bumped twice. Moving the wake-window expiry above the status read keeps its old semantics. - Writing back a non-W1C word: writing the same value back is a no-op, and the mapping is non-exclusive (no region request), so the drivers that own those sub-ranges keep probing. Your 0
-EBUSYrow agrees. - Exact-head J413 row (boot, 3 s2idle, 3 committed deep wakes with backoff), KUnit 34/34.
Follow-ups (non-blocking):
apple_soc_edac_parse_event_logs()runs after the IRQs are requested. The thread readsnevent_logswithout a barrier against theevent_logs[]fill. Either parse before requesting the IRQs, or publishnevent_logswithsmp_store_release()and read it withsmp_load_acquire(). It's only a window at probe, but it's cheap to close.- A line with event logs that fires with no word set now logs "asserted with no status set" and backs off without a UE report. That's reasonable, but worth one line in the commit message.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Two issues in drivers/edac/apple_soc_edac.c. First, apple_soc_edac_parse_event_logs() uses the DT register index to size the arrays before checking that a matching memory resource exists. A malformed index can wrap max_reg or leave it undersized, and the second pass indexes mapped[] and sizes[] before platform_get_resource() can reject it. Validate each register resource in the first pass before sizing or indexing. Second, the successful wake-ack path returns with wake_window still open, which the new KUnit test explicitly expects. Once all wake status bits read back clear, a second assertion in that minute is a fresh event, but the handler suppresses its UE too. Close the window on a successful wake acknowledge and cover a second fresh interrupt in the test. The J413 sticky-word row is useful and still covers the fallback.
… window on clear Validate each apple,event-logs register index and word offset against platform_get_resource(IORESOURCE_MEM) during pass 1 before sizing the shared-mapping table, avoiding oversized or wrapped allocations on malformed DT properties. Close wake_window once a wake-latched event-log interrupt clears all set status words so a subsequent assertion within the same minute reports as a fresh uncorrectable error, and extend the KUnit wake-window test to verify that second interrupt. Parse apple,event-logs and apple,wake-latched-sources before requesting threaded IRQs in probe so all per-IRQ state is initialized before registration. Signed-off-by: Satya Benson <satya@benson.earth>
|
Addressed in
Verified offline: KUnit |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Both findings are fixed. The first pass validates each active entry’s register resource, alignment, and offset before sizing or indexing the mapping array. A cleared wake acknowledge now closes the window, and KUnit covers the next assertion reporting as a fresh UE while sticky status still backs off. Probe initializes the per-IRQ state before registration. Hosted CI and the updated J413 row remain open.
|
Merging at |
|
This landed on |
|
Closing: this is merged. |
|
Row: b400ecf + J413 (MacBook Air 13" M2, T8112, 27.2 stub) + PASS
|
…ac-event-log-ack EDAC: apple_soc_edac: read and acknowledge DT-described event-log status words
What: add DT-driven status read and write-1-to-clear acknowledge for Apple SoC event-log sources, and populate T8112's event-log status words from the ADT.
Background:
0x23b000000). EDAC: apple_soc_edac: count a wake-latched event-log source after a wake, do not report it #3659 silences the repeated false UEs viaapple,wake-latched-sources, leaving the line masked on backoff becauseapple_soc_edachad no status/acknowledge path for event-log nodes./arm-io/event-log-handlernode already carries anevent-logsproperty (18<line reg offset>triples across the 16 event-log interrupt lines, including source 2 atreg2+0x28000and+0x6c004).Changes:
Documentation/devicetree/bindings/edac/apple,soc-error-handler.yaml): document the optionalapple,event-logsmatrix of<interrupt-index reg-index offset>triples.drivers/edac/apple_soc_edac.c,drivers/edac/apple_soc_edac-internal.h):apple,event-logsat probe and map each referencedregaperture once without requesting an exclusive memory region (event-log apertures span shared SoC blocks whose sub-ranges are claimed byclock-controller,watchdog,reset-controller, and sleep drivers), while honoringIORESOURCE_MEM_NONPOSTED.IRQ_HANDLEDwithout masking the line. If any word stays set or no word was set, fall through to the existing mask-and-backoff path so sticky lines cannot storm.wake_window(forapple,wake-latched-sources), log at debug with no UE report, stay unmasked if the acknowledge clears the line, and avoid double-counting if a sticky word falls through to backoff.arch/arm64/boot/dts/apple/t8112-peripherals.dtsi): add all 18<line reg offset>triples from the T8112 ADT tom2_event_log_handler.apple,wake-latched-sources = <2>is retained, as hardware testing below confirmed both source 2 words stay0x1after W1C.drivers/edac/apple_soc_edac-test.c): add 6 tests covering multi-word read/ack, zero status, sticky status, normal IRQ handling, empty/sticky backoff, and wake-window interaction.Tested:
5e4086dba70ewith its ownt8112-j413-fw27.dtb(/proc/device-tree/soc/event-log@23b700000/apple,event-logs, 216 bytes = all 18 triples): probed cleanly across overlapping MMIO apertures (0-EBUSY,monitoring 16 error sources,0failed units).boot_id=0dfa0434-b866-4ffb-8da8-a7e4fb1e1d31):0event-log interrupts,ue_count=0.boot_id=e6a7d3b3-7b59-4411-836c-43a087c2bd5f,apple_sleep.deep=1 apple_sleep.untested_commit=1 apple_soc_edac.dyndbg=+p,boot object resumes 0 -> 1 -> 2 -> 3):0x1on wake and stayed0x1after the W1C acknowledge (event-log source 2: status 0x1 at reg 2 +0x28000, 0x1 after the acknowledgeandstatus 0x1 at reg 2 +0x6c004, 0x1 after the acknowledge).89.23 s -> 90.24 s -> 92.29 s -> 96.32 s -> 104.64 s -> 121.03 s -> 153.28 s), keepingue_count=0with no IRQ storm and no error output whendyndbgis off.apple,wake-latched-sources = <2>must stay on T8112 (whether the latch clears via another underlying register or only on power-off is left for follow-up).drivers/edac/apple_soc_edac.kunitconfig,arm64,LLVM=1): 34/34 PASS (28 existing + 6 new).W=1 LLVM=1compile: 0 warnings for bothCONFIG_EDAC_APPLE_SOC_KUNIT_TEST=yand modularCONFIG_EDAC_APPLE_SOC=m(KUNIT=n).dt_binding_check(DT_SCHEMA_FILES=edac/apple,soc-error-handler.yaml): clean.CHECK_DTBS=y(t8112-j413.dtb,t8112-j413-fw27.dtb,t8112-j473.dtb,t8112-j493.dtb): 0 warnings onevent-log/error-handler.scripts/checkpatch.pl --strict --git origin/main..HEAD: 0 errors, 0 warnings, 0 checks across all 3 commits.Untested on hardware:
edac_test_event_log_status_words,edac_test_irq_event_log_error, andedac_test_irq_event_log_wake_window).Risk: two-way door · T8112 Macs (and any future SoC adding
apple,event-logs). Nodes withoutapple,event-logskeep identical behavior; on T8112, mapping is non-exclusive and any word that does not clear on W1C falls back to the existing mask-and-backoff path.