Skip to content

soc: apple: display-gate: request T8122 storage by soc-device record - #2682

Draft
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
j615s2r/t8122-storage-record
Draft

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
j615s2r/t8122-storage-record

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem. On T8122 (M3: J613, J615) the PMP's power request and acknowledge bits are indexed by soc-device record, not by device ID - 1. The display gate already marks the display entry apple,soc-device-record for that reason. It leaves the storage entry (report@11, ANS, device ID 18) on its ID bit, 17, though. On these Macs bit 17 belongs to a different record (the device ID 14 record, report@d), so the PMP is asked to keep that block up, and ANS's own record bit, 19, is never set. The native T8122 path in pmp-report already expects ANS at bit 19 (apple_pmp_record_of_id(table, 18) != 19).

Change. Where the PTD is indexed by record (gate_soc->records), the display gate marks the storage entry apple,soc-device-record as well. The bit then comes from the PMP's own soc-device table, the same way the display entry's does. No new property, parameter or board check.

Testing. J615 (MacBook Air 15-inch, M3) on its default Stage 2 and the default kernel command line. Kernel: our T8122 sleep trial tree plus this commit, same file and hunk as here.

  • T8122 PMP handed over: requests 0x80800 (was 0x20800), and request bits 0x80800 are soc-device records.
  • The PMP starts, PMP ready: ... ack 0x8f0. The display record is acknowledged, and ANS is not, as its record's flags say. Before, the PMP acknowledged bit 17, i.e. it was keeping the other record's block up.
  • NVMe: 1 GiB direct read at 3.5 GB/s, no NVMe errors. The internal panel stays connected.
  • Two s2idle rounds (PMU RTC, 20 s): rc 0, 19.6 s wall clock. 0 failed units.
  • checkpatch --strict clean. display-gate.o builds on this base with W=1.

Still to run. A J613 row (the other T8122 Mac). There the PMP runs with the GPU, so this changes what it is asked for at start: ANS instead of the device ID 14 block.

Detail for reviewers
  • How it was found: lane J615-S2R2 (T8122 deep sleep, soc: apple: J613 (T8122) suspend-to-RAM on the shared T8142 sleep framework (draft: wake unshown) #2572). A test that set every PMP report entry always-on failed with no unique request bit for /soc/pmp_report@2d03c0000/report@11. The added scodec entry (record 17) collided with the storage entry's ID bit 17.
  • Why the bits are records: with the old request 0x20800, the PMP's unrequested ack bits are 4-7. Those are the records of the always-on SoC and CPU-cluster devices, which only fits record indexing.
  • Records vs ID bits on the J615's soc-device table: ID 8 (DISP) is record 11, ID 18 (ANS) is record 19, ID 14 is record 17.
  • Effect on T6031 (report@21): none. records is set for T8122 only.
  • Row logs: traces/power/20261121-j615-s2r2/row-stor.log, stor-*-dmesg.txt on our store.

Assisted-by: LLM (Claude:Opus 5.5)

On T8122 the PTD request and acknowledge bits are indexed by soc-device
record, not by device ID - 1. The gate already marks the display entry
apple,soc-device-record for that reason, but left the storage entry
(report@11, ANS, device ID 18) on its ID bit, 17. On T8122 that bit is
another record's (the device ID 14 record, report@d), and ANS's own
record bit is never set. The native T8122 path in pmp-report already
expects ANS at its record, bit 19.

Mark the storage entry by record too, wherever the PTD is indexed that
way (gate_soc->records). The bit then comes from the PMP's own
soc-device table, as the display entry's does.

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

Copy link
Copy Markdown
Contributor Author

Looks good; approve once a J613 row and a J615 row run on this head.

  1. drivers/soc/apple/display-gate-test.c:309-315: gt_expect_enabled() checks apple,soc-device-record on the display entry only. The new storage marking is untested, and the KUnit suite passes with or without this commit. Add the same KUNIT_EXPECT_EQ(..., s->soc->records) for s->ans. Also add the matching KUNIT_EXPECT_FALSE for s->ans in the disabled case (:276).
  2. The J615 row ran on a sleep trial tree, not on this head on integration/aurora. A 27.2-stub J615 on integration/aurora stops at the PMP image pin (drivers/soc/apple/display-gate.c:165, :769-772) before gate_reuse_apply() runs. So the row has to say which PMP image ran, and on 27.2 it needs linux#2688 under it. Otherwise this code is never reached.

The change itself is right. pmp-report resolves every marked entry through apple_pmp_report_record() (drivers/pmdomain/apple/pmp-report.c:920-942), both in the start seed (:1199-1209) and in the runtime entry probe (:3398). So ANS's genpd votes, not just the seed, move from bit 17 to its record bit 19. That matches the native T8122 check (:998-1003). After this, every available T8122 report entry is requested by record: display and storage here, and the external display entry on the dcpext path (display-gate.c:1977). records is set only for T8122 (:283), so T6030/T6031 are unchanged. gate_add_bool() doesn't duplicate the property that the J613 25G83 dtsi already sets. Signed-off-by is human, there are no agent trailers, and CI is green.

Nit: the remaining T8122 entries (report@5/6/9/a/b/c/d, t8122.dtsi:776-863) are disabled and still ID-indexed. Whoever enables one hits this same bug. Marking the record indexing once on the T8122 report would cover them all.

HW row: on dc5faac on integration/aurora (plus linux#2688 if the Mac runs the 27.2 stub), default command line. J613 and J615 each log requests 0x80800 and request bits 0x80800 are soc-device records, PMP ready, the panel on appledrm, the GPU up (J613), a 1 GiB NVMe read with no errors, s2idle 2/2, 0 AVC, 0 failed units and 0 new kernel errors.
Assisted-by: LLM (Claude:Opus 5.5)

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