Repository navigation
soc: apple: suspend-to-RAM on the M4 Max (T6041, J616c) - #1664
Conversation
|
Tried this on a J614c (MacBook Pro 14" M4 Max, 40-core GPU), os-fw 26.6.2, EL2 through aura main d5e180ba. The kernel was GPU: the 40-core part runs Then it hangs:
PMU notes (
The count drops by 10, the two removed devices' callbacks, so the hang comes at the same point in the sequence. The noted device looks like whatever is next, not the cause. My guess: something is already stuck by then, possibly around the SEP going to sleep at device suspend. One more J614c data point, from #1477's hibernation dry runs on this machine: at every |
84f27ca to
fe530fa
Compare
|
Thanks for trying it on the J614c, this helps a lot. I think the hang is the SEP's DART. On my J616c the bring-up device tree gives I've pushed four commits for it:
To try it on your current build, this in your DTS should be enough:
|
fe530fa to
3862ef2
Compare
|
Thanks, the SEP DART lists were it: the hang at Same J614c (MacBook Pro 14" M4 Max, 40-core GPU), os-fw 26.6.2, aura 1.0.0b12 + aura#166 + a local dcpext3 entry. Kernels:
Real sleep, PMU scratch after the 35.6 reset (
So the commit looks clean from here: nothing busy, the SEP asleep, the USB-C domains down. The failure is after it: the RTC wake doesn't come, or the wake path resets before it reaches Linux. One more thing: with Wi-Fi WoWLAN enabled ( I'm happy to run more: a different wake source, a debug build, or other PMU offsets. |
|
Thanks, that's a big step: the commit really is clean now. Your 35.6 record matches the commit record of my J616c when it wakes fine almost byte for byte: 3 non-PS and 52 PS rows differing from macOS, the same 0x8342-0x834c, the same PS bytes, nothing busy, the SEP asleep, the USB-C domains down. Only the first differing PS row differs: My best guess for the reset: your kernel has #1667, #1684 and a local dcpext3 entry, so it runs more external DCPs than mine. The display stop before the sleep kept one "already stopped" slot per external DCP by name: dcp@3a2e00000 got one, and every other external DCP shared the second. So with three or four external DCPs, the second one stopped took that slot and the rest were skipped, their firmware still running at the commit. Only the first two chains' DARTs were made dark, too. I've pushed Two things that would tell us more:
The pm_test=platform black panel is a real gap: the display stop assumes a real sleep follows. Under pm_test the firmware is stopped but never power-cycled, and the restart path expects a power cycle. So pm_test=platform with the display isn't supported yet. I'll put that in the PR text, along with your WoWLAN note (brcmfmac refuses |
|
Thanks! The raw PMU scratch 0x8300-0x83ff from that 35.6 run ( Correction to my last comment: 0x8359/5a fall inside the bitmap, which is written after them, so the fac697f: still resets. Built as fac697f with fe530fa's (the other lines are as above.) Next I'll try your other suggestion, only dcpext0/1 enabled, by booting an aura without the dcpext2/3 fill so the gate leaves those chains off. |
|
Only dcpext0/1: still resets. Same 35.8 kernel (fac697f + fe530fa's sleep files for the marks), with an aura from main just before #166, so The record is the same again: mark 0x06, nothing busy, the same 0x8308-0x834c, and fab3_soc 0xff. The 53rd PS row is now dcs_10 (macOS 0x4f, here 0xff) instead of nub_spmi4, so that row seems to vary between runs. So with the same external DCPs as your J616c it still resets, and across the three runs fab3_soc at 0xff is the only difference from your record that stays. Is there anything on fab3 that the J614c has and the J616c doesn't, or that I could take out to test? |
|
Your exact branch: still resets. Built fac697f as it is (base integration/aurora 9219565), with only fe530fa's The record is byte for byte the one from my first 35.6 run: mark 0x06, nothing busy, 3 non-PS and 52 PS rows differing from macOS with the same bitmap and bytes, fab3_soc 0xff. So on the J614c it resets in every configuration I tried (4 or 2 external DCPs, my tree or yours) with the same clean commit record, and fab3_soc is the one row that differs from your J616c every time. Happy to try a patch that does something to fab3 before the commit, or to read anything else after the reset. |
|
Thanks for running all of those. Same record in every configuration, with fab3_soc on, rules out the external DCPs. One difference between our setups I can name: your kernel boots the in-tree device tree, mine boots my bring-up one, and they describe fab3_soc's children differently (in-tree: So, to see which domain it is, a small patch on top of fe530fa's diff --git a/drivers/soc/apple/t6041-sleep.c b/drivers/soc/apple/t6041-sleep.c
index 15130a0..bd61e84 100644
--- a/drivers/soc/apple/t6041-sleep.c
+++ b/drivers/soc/apple/t6041-sleep.c
@@ -404,6 +404,32 @@ static int t6041_ps_match_all(void)
* 0x837e..0x83a1 the first 6 non-PS diffs as u16 index + u32 value;
* 0x83a2..0x83ff each differing PS row's [7:0] (actual, target), in row order, 94 of them.
*/
+/*
+ * DIAG: every PS word that reads on (ACTUAL != 0) at the commit, as bitmaps in PMU SRAM, bit n
+ * of byte n / 8 = the word at +8 n: 0xa300 the main PMGR (0x502800000, +0x000..+0x4f8, 20
+ * bytes), 0xa314 East (0x502280000, +0x000..+0x3f8, 16 bytes), 0xa324 AON (0x508300000,
+ * +0x000..+0x178, 6 bytes); 0xa32a = 0x50 when done.
+ */
+static void t6041_ps_on_map(struct t6041_sleep *s)
+{
+ static const struct { u16 at, words; } blk[3] = { { 0xa300, 160 }, { 0xa314, 128 }, { 0xa324, 48 } };
+ void __iomem *base[3] = { s->ps, s->east, s->ps_aon };
+ unsigned int b, i;
+
+ for (b = 0; b < 3; b++) {
+ for (i = 0; i < blk[b].words; i += 8) {
+ u8 byte = 0;
+ unsigned int j;
+
+ for (j = 0; j < 8; j++)
+ if (FIELD_GET(PS_ACTUAL, readl(base[b] + 8 * (i + j))))
+ byte |= BIT(j);
+ t6041_pmu_write(s, blk[b].at + i / 8, byte);
+ }
+ }
+ t6041_pmu_write(s, 0xa32a, 0x50);
+}
+
static void t6041_reg_diff(struct t6041_sleep *s)
{
unsigned int i, n[2] = { 0, 0 };
@@ -1210,6 +1236,7 @@ static int t6041_sleep_commit(unsigned long unused)
busy_n < ARRAY_SIZE(busy_rows))
busy_rows[busy_n++] = i;
MARK(s, 6);
+ t6041_ps_on_map(s);
t6041_commit_t = read_sysreg(cntpct_el0);
for (i = 0; i < ARRAY_SIZE(t6041_macos_regs); i++)
t6041_reg_now[i] = readl(t6041_reg_map[i]);After the reset: |
|
For comparison, the same map from my J616c: one RTC deep sleep (20 s) at the greeter on a kernel with fe530fa's sleep files plus the patch above. It woke normally (0x8308 = 0x67). Bit n of byte n/8 is the word at +8n. fab3_soc is East +0x118 (byte 4, bit 3): off here, as the 0x0f in the PS rows says. Any bit that is set in your map and clear in mine is a domain still on at your commit, and the likely holder of fab3. This run's 0x8350/1 read 03 35 (53 PS rows), so the 53rd row varies on mine too. |
|
The map from the J614c, same build as my exact-branch run (fac697f + fe530fa's sleep files) plus your patch, Nothing is on in yours that's off in mine. On here and off on your J616c, named from the J614c ADT's pmgr
So at the commit this machine has all 32 memory controllers on (AMCC0-31), and yours has 24 (AMCC0-23). This one is the full M4 Max (16 CPU cores, 64 GB, 512-bit). Going by the 24, I guess yours is the binned one (14 cores, 36 GB, 384-bit)? AMCC28-31 and DCS_28-31 sit in the East block with FAB3_SOC, so fab3 looks like the fabric for that last quarter of DRAM. If that's right, it isn't a leaked domain but the extra channels, and whatever the sleep path does per memory channel (or the macOS table it's checked against) only covers 24 of them. If you have a macOS table or sequence from a 512-bit M4 Max, or want me to try something per channel for AMCC24-31, I can run it. One aside: this boot came from the J614c's aura build with the dcpext3 entry rather than stock main (update-m1n1 didn't switch it), but the gate still only enabled dcpext0/1, as in the exact-branch run, and the commit record is the same as before (mark 0x06, nothing busy, 3 non-PS and 52 PS diffs, fab3_soc 0xff). 🤖 Generated with Claude Code |
|
That's it, thanks. Yes, mine is the binned one: 14 cores, 36 GB, 384-bit. On it, the words you list read target and actual 0 live (amcc24 +0x248 = 0x0f000300, amcc28 East +0x2c0 = 0x0f000300), so those channels are fused off. The sleep path is written for 24 channels throughout, not only the macOS table:
So on yours, the last eight channels are never flushed, and their PS words stay forced on. That holds fab3_soc at I've pushed
One check before you run it: the AMCC and DCS addresses for groups 6 and 7 are extrapolated from the first six: AMCC block If it still resets, the same map with the new commit would show whether fab3_soc came down. |
|
f3fcc17: still resets. The addresses match the J614c ADT first:
So it's fresh, and it's bit for bit the map from before the change: AMCC24-27, DCS_24-26 (main +0x248..+0x280), AMCC28-31 and DCS_28-31 (East +0x2c0..+0x2d8, +0x340..+0x358), and FAB3_SOC (East +0x118) still read on at that point. Note that on your J616c map AMCC0-23 read on at the commit too, so on AMCC/DCS words seem expected there. What's still different is fab3_soc, which stays on here alongside the extra channels even with them on AUTO. If it helps, I can dump the raw words (target, AUTO, flags, actual) of those 15 plus fab3_soc at the same point, or try whatever you'd like done to fab3 or the extra channels before the commit. 🤖 Generated with Claude Code |
|
Thanks for checking the addresses and for the run. Agreed: AMCC/DCS reading on at that point is expected, because their AUTO state only drops them once the commit has gone quiet. fab3_soc is the one real difference. Yes, the raw words would help most. Could you dump these 16 at two points: where the map runs now, and right after
Writing them as 32-bit words from 0xa340 (16 x 4 bytes, then the second set from 0xa380) keeps them clear of the map. Those words would tell us three things:
If fab3_soc is at AUTO 4 with the extra channels on AUTO, then the next suspect is the fab3 child the J614c has and mine doesn't. In your bring-up DTB, fab3's children are sio, ans, apcie_sys_st1 and apcie_sys_gp. |
|
The raw words, f3fcc17 + your map + a dump of the 16 words at both points (u32 LE, in your order: amcc24-27, dcs_24-26, amcc28-31, dcs_28-31, fab3_soc). 0xa300..0xa3bf was zeroed first; after the reset the done marks 0xa32a/b/c read 50 51 52, so all three sets are from this run. It reset as before.
Raw dump of 0xa340..0xa3bf for reference: 🤖 Generated with Claude Code |
|
One more thought on those words, and a question.
The children both machines have (sio, ans, sep) read the same in both maps. The only difference is the eight extra channels, and AMCC28-31/DCS_28-31 sit in the East block with fab3. On your binned part they're fused off and fab3 goes to 0. So I suspect fab3 is the fabric for that last quarter of DRAM, and with those channels at auto state 4 (which macOS allows for the DCS words too), fab3 has to stay up on a full part. If so, fab3 at f is expected here, and the reset comes from something a binned-J616c reference can't show. So, how did you capture the macOS commit state on your J616c? If it's something I can run on this J614c under macOS (26.6.2), a full-part table would show what macOS really does with fab3_soc and AMCC24-31 at the commit, and what else differs. I'd rather get that than guess at memory fabric power before the commit. If you'd like the theory confirmed first, I can do one more run that rewrites fab3_soc to auto state 4 and the extra AMCCs to 0 at the map point, waits, and dumps the words again. 🤖 Generated with Claude Code |
5499579 to
7288144
Compare
|
Same result on the new head (7288144, with the integration/aurora merge) plus the same two diag commits: 32 memory channels, 🤖 Generated with Claude Code |
|
I tried one more idea on the J614c, from the M5 Max sleep in #2119. There the commit dropped all the CPU clusters together, the P cluster's power-down queued behind the boot cluster's and never finished, and the engine's watchdog reset the chip 5 s after the commit. The fix was to take the secondary clusters down first and poll until they're done. Our symptom is the same, so I checked whether it applies here. Diag on 7288144: the cluster block (0x502820000, +0x00..+0x38) dumped to PMU SRAM at three points in
E and P1 change at once and read 0 by the last point, the same as the AVE complexes. Only the boot cluster is still at 0x10. That is the order #2119 needed, so I don't think this is our reset. T6041 has no T6050-style sequencer status words at +0x18/+0x1c (everything past the AVE words reads 0), so this is based on the cluster words only. Same reset as before. So I'm back to the AMCC words. Your comment in 🤖 Generated with Claude Code |
|
Found it: on the full T6041 the reset is dcs_27, and with one line added the J614c sleeps and wakes. A diag kernel on 7288144 dumped the PS words of all 32 AMCC slices and all 32 DCS channels right after The fix, with the value your table has for the other DCS words: { 0, 0x280, 0x1000030f }, /* amcc27 */
+ { 0, 0x530, 0x1400034f }, /* dcs_27 */
{ 1, 0x2c0, 0x1000030f }, /* amcc28 */(and On 7288144 plus that line, J614c (16/40, 32 channels, os-fw 26.6.2), one boot:
Still open on the J614c:
🤖 Generated with Claude Code |
|
Two more things from the J614c, one bad and one good. Merged with a newer integration/aurora, the wake hangs. I merged 7288144 (plus the dcs_27 line) into integration/aurora c0a2a75 (15 Nov) for my daily kernel. Five conflicts, all resolved by keeping both sides: The same set of extra commits cherry-picked onto your branch instead (7288144 + dcs_27) wakes every time. So it's something in integration between your base (fc05050) and c0a2a75. That range is 19 PRs, and the one that touches the sleep path is #1963 (T6050 S2R: The SD reader after a wake. I found the cause of the @@ static int apple_pcie_resume(struct device *dev)
if (!port || !port->hib_cold)
continue;
+ /*
+ * The PCI core's noirq power-up ran with the link down and left the function
+ * marked D3: the reset brought it up in D0, so record that before the
+ * restore, or its driver's resume can't enable MSI again (-EINVAL).
+ */
+ pci_set_power_state(fn->pdev, PCI_D0);
if (pci_load_saved_state(fn->pdev, fn->state))With it, on 7288144 + dcs_27: two Still open here: 🤖 Generated with Claude Code |
7288144 to
8f34100
Compare
|
Rebuilt the series without the merge commit: the 37 commits now sit directly on fc05050, the merge's It still conflicts with current Disclosure: prepared with an AI tool (the commits carry Assisted-by: LLM); tested on my M4 Max as described. |
|
An overnight result from the J614c (16/40), on 7288144 + dcs_27 + the SD fix and a few unrelated cherry-picks, now my daily kernel. Battery: one lid-closed deep sleep of 9 h 30 min, unplugged. After that wake: panel, Wi-Fi (I'm typing this over it), speakers, Bluetooth and the camera all work. The camera also worked after earlier wakes, so the description's note that the ISP doesn't come back is out of date, at least for T6041. No EDAC Brightness after a lid wake: two parts.
I can push the brightness change somewhere if it's useful, but it's a workaround for the level, not the whole fix. 🤖 Generated with Claude Code |
Clear any stale pending edge/level latch after unmasking a level GPIO interrupt during resume so unmasked level lines (such as speaker amplifier fault/interrupt lines after a firmware sleep) do not trigger an interrupt storm on wake. Signed-off-by: AxxzyWasTaken <[email protected]>
After a firmware-driven sleep on a conventional PCIe host, the BCM4377 Bluetooth controller loses power and must be rebound after resume so its firmware and rings are cleanly reinitialized. Update the bcm4377 resume host test fixture accordingly. Signed-off-by: AxxzyWasTaken <[email protected]>
A conventional Apple PCIe host (internal Wi-Fi, Bluetooth, and SD card reader ports) loses power across a firmware-driven deep sleep, leaving endpoints unpowered or in reset behind down links. Unconditionally save conventional port state in suspend_noirq, snapshot endpoint saved state before PCI core noirq resume spends it on a down link, retrain cold ports (PWREN, PERST#, link-up, 100 ms PCIe r5.0 6.6.1 settle, RID-to-SID map, and interrupt mask) in resume(), and restore endpoint configuration. Enable async suspend/resume on the host so link retraining runs in parallel with NVMe and display resume. Signed-off-by: AxxzyWasTaken <[email protected]>
…p-pmvc Describe the apple,sleep-wake-type boolean property (write WKTP sleep/wake state around firmware sleep commit) and the apple,sleep-pmvc u32 property (VDD_CIO rail mask written to the SMC pmVC key before sleep commit). Signed-off-by: AxxzyWasTaken <[email protected]>
Drive SMC WKTP and pmVC sleep-commit writes from the apple,sleep-wake-type and apple,sleep-pmvc DT properties rather than machine-compatible checks: - When apple,sleep-wake-type is set, write WKTP = 2 before slpa at sleep commit and restore WKTP = 0 on a full wake (or in .complete if sleep was refused), preventing the SMC from remaining in power-nap fan/thermal policy after wake. - When apple,sleep-pmvc is set, log the boot pmVC at debug level and write the DT-specified VDD_CIO rail mask (bit 8 plus bit n keeping port n's CIO rail powered across sleep) before slpa, refusing sleep if either WKTP or pmVC fails. - Gate apple_smc_suspend_noirq()/resume_noirq() on pm_suspend_via_firmware() so s2idle does not enter the firmware-sleep path. Signed-off-by: AxxzyWasTaken <[email protected]>
Look up T6041's GPU power domain from PMP report entries in g17/sleep.c and enable sleep_restart on both the 32-core (t6041_25g83::CONFIG) and 40-core (CONFIG_25G83, tested on J614c by joske) T6041 profiles so the GPU stops cleanly before deep sleep and warm-restarts on wake. Signed-off-by: AxxzyWasTaken <[email protected]>
Add apple_dart_display_keep() so the display driver can preserve and restore T6041 display/DCP DART stream translation state across host-driven display power-down and warm restart during suspend-to-RAM. Signed-off-by: AxxzyWasTaken <[email protected]>
… domains When a device tree describes external display chains referencing disabled DISPEXT power domains, drop the dangling power-domains property on gated chain nodes so their devices do not wait on unavailable domain providers and defer-timeout the display subsystem. Trees without DISPEXT power domains are unaffected. Signed-off-by: AxxzyWasTaken <[email protected]>
Add apple,sleep-host-stop and apple,display-power to apple,dcp.yaml and extend apple,t8140-display-power.yaml with the apple,t6041-display-power binding describing the PMC, power-gate, GAPF, AXI2AF register windows and per-chain PMGR power-domain phandles used during T6041 display S2R. Signed-off-by: AxxzyWasTaken <[email protected]>
Implement host-driven display stop and warm restart for T6041
suspend-to-RAM, driven strictly from the apple,sleep-host-stop and
apple,display-power DT properties without hardcoded addresses or unbacked
fixed delays:
- Parse the apple,display-power node's register windows (pmc-dcp, pwrgate,
pwrgate-aux, gapf, axi2af) and per-chain PMGR power-domain phandles
from DT at probe, failing sleep cleanly if required resources are
missing.
- Handle every enabled external DCP and mark all external chain DARTs dark
by DT node before lowering their power words so post-wake framebuffer
unmaps never flush a DART behind a powered-off block.
- On 26.6 desktop firmware, route D572 through dcp_s2r_dart_power() and
complete s2r_dart_done only on 0 ("done with display"), track in-flight
dcp_ack() replies in iomfb_channels_idle(), send A500, idle RTKit, and
poll hardware COPROC, GAPF, and PMGR PS_ACTUAL/PARENT_OFF status with
bounded timeouts and error unwind.
- On wake, raise the internal display domains, restore DART streams,
warm-restart DCP firmware, wait for D575 hotplug completion and channel
idle, recommit the active CRTC mode, restore backlight (with
dcp_backlight_s2r_restore() declared in dcp_backlight.h), and restore
boot power-word state. Propagate errors in apple_platform_suspend/resume.
Signed-off-by: AxxzyWasTaken <[email protected]>
Allow the T6041 shared APCIe storage/PHY register windows (axi2af, cio3pll, clkgen, phy-block, phy-ip) and bootloader-provided apple,tunable-* properties on apple,t6041-pcie so the sleep driver can reinitialize the storage PCIe link after deep sleep strictly from DT. Signed-off-by: AxxzyWasTaken <[email protected]>
Add the DT binding schema for apple,t6041-sleep describing its register windows (ps-aop, cluster, pwrgate, cpu-start, wdt, aon-misc, commit, clk-mux, ka-pmgr, ka-east, pmc, ptd, perf, wake, AMCC/DCS banks, and AXI2AF bridges), pinctrl/SPMI/ATC-PHY/APCIe phandles, wake source IDs, and PMGR power-domain phandle lists (including apple,atc-off-domains). Signed-off-by: AxxzyWasTaken <[email protected]>
Add the EL2 suspend-to-RAM platform driver for Apple T6041 (M4 Max), committing sleep and returning to cpu_resume through aura's S2R mailbox: - Bind only when aura publishes the S2R mailbox and bootloader-provided APCIe tunables (apple,tunable-* via <linux/soc/apple/tunable.h>) are present in DT; otherwise fail probe with -ENODEV so the machine stays on s2idle. - Map all MMIO windows from DT reg-names and resolve all PMGR power-state words from DT phandle lists, topologically sorting sleep-off and restore lists from DT power-domains edges with cycle detection. Uniformly skip fused-off channel words across 24-channel (binned J616c) and 32-channel (full J614c, including dcs_27 at main +0x530 found by joske) parts. - Advertise commit-time enclave/coprocessor stops, hold parked CPUs via spin_table_hold_parked() before stopping them, check coprocessors and pm_wakeup_pending() before the refusal boundary, and stop SEP and coprocessors at commit so aborted suspends do not strand Touch ID or SIO. - Use pure arch_timer_read_counter() + cpu_relax() polls in the commit path (avoiding arm64 WFIT/WFET early power-gating) to poll ATC, sleep, DCS/SoC perf, secondary CPU/CPM, and SPMI hardware states with wake-time timeout reporting, retaining only the two hardware-documented fixed spins (5 ms PTD SOC-DEV-PS-REQ pulse and 3 ms commit-to-WFI gap) and the 1 us PHY refclk settle on wake. Signed-off-by: AxxzyWasTaken <[email protected]>
…splay-power Wire suspend-to-RAM in the T6041 SoC and J614c/J616c board device trees: - Add pmgr_disp, t6041-sleep-pmgr.dtsi (keeping newly added firmware-owned power-state nodes disabled), SEP DART sleep-prepare/restore lists, and the ps_venc1_sys -> ps_fab0_soc parent link in t6041.dtsi. - Add the t6041_sleep node in t6041.dtsi (disabled at SoC level so boards without qualified deep sleep such as J575c remain on s2idle) with all DT reg windows, wake sources, and PMGR domain phandle lists (including apple,atc-off-domains). - On t6041-j614c-j616c.dtsi, add the dcp_power node, wire apple,sleep-host-stop and apple,display-power on &dcp, apple,sleep-wake-type and apple,sleep-pmvc = <0x101> (VDD_CIO bit 8 + port 0 bit 0) on &smc, the shared APCIe storage/PHY reg windows on &pcie0, and enable &t6041_sleep. Signed-off-by: AxxzyWasTaken <[email protected]>
…PS skip scope Fix three suspend-to-RAM commit regressions in the DT-driven T6041 sleep driver: 1. Replace the DFS-and-reverse topological sort in t6041_topo_sort() with a stable (input-order-preserving) Kahn's topological sort (forward for child-first shutdown, reversed-index child-first reversed back for parent-first restore so edge-free auto-managed DCS nodes stay after their AMCCs), add the missing ps_apcie_sys_gp parent edge on ps_apcie_phy_sw, and order ps_ans before ps_apcie_st1/st0/gp in apple,sleep-off-domains. This ensures ps_apcie_phy_sw lowers before ps_apcie_sys_gp/sys_st*/ans and ps_apcie_st*/gp lower after sys_*/ans, avoiding PARENT_OFF bit 11 latches. 2. Match all three CPM power-state words (ecpm, pcpm0, pcpm1) in t6041_cpu_ps_match() instead of stopping at index 2, clear PS_AUTO_STATE alongside PS_TARGET/PS_AUTO_ENABLE, and clear any stray target/auto bits on absent/fused-off CPU words without raising them. 3. Restrict fused-off channel skipping in t6041_ps_match_all() strictly to AMCC/DCS memory channel slices (amcc*/dcs_*) so idle non-channel domains such as fab6_soc still enter hardware AUTO, and restore the 20 ms SPMI quiet window before clearing the keep-alive tables. Signed-off-by: AxxzyWasTaken <[email protected]>
1f82e44 to
fc4c0a6
Compare
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Audited the new top commit fc4c0a683b15 (soc: apple: t6041-sleep: fix APCIe topo order, pcpm1 match, and auto-PS skip scope) and its CI on main post-#3111:
- Stable Kahn's topological sort (
drivers/soc/apple/t6041-sleep.c:1509-1656):t6041_topo_add_ancestors()correctly deduplicateschild -> parentedges via!__test_and_set_bit, handles transitive ancestors not in the target list, catches self-cycles and general cycles (!found->-EINVAL), and frees all temporary allocations on every exit path. Running forward forchild_firstand reverse-index reversed for parent-first restore preserves input order for edge-free nodes (keeping auto-managed DCS nodes after AMCCs), and adding<&ps_apcie_sys_gp>tops_apcie_phy_sw+ orderingps_ansbeforeps_apcie_st1/st0/gpaligns shutdown ordering cleanly. - Scoped fused-channel skip & CPM/CPU matching (
t6041_ps_match_list,t6041_cpu_ps_match): Restricting the!(PS_TARGET | PS_ACTUAL)skip toamcc*/dcs_*viadevm_bitmap_zallocensures non-channel idle domains likefab6_socstill enter hardware AUTO. Looping allT6041_CPM_COUNTwords fixes the missedpcpm1word, and absent/fused-off CPUs have strayPS_TARGET | PS_AUTO_ENABLE | PS_AUTO_STATEbits cleared without raisingPS_TARGET. The 20 ms SPMI quiet window before clearing keep-alive tables is clean. - CI (
fc4c0a683b15): All checks (kunitincludingSEP source checks / kunit,dt-checks,host-tests,rust-build,source,DWC3/ATC,readiness,pr-text) still pending (DWC3/ATC builtin-no-atc=queued/-, DWC3/ATC builtin-modular-atc=queued/-, kunit=in_progress/-, dt-checks=in_progress/-, rust-build=in_progress/-, kunit=in_progress/-, host-tests=in_progress/-, kunit=in_progress/-). Code looks solid — holding formalAPPROVEstrictly until remaining CI checks finish green.
|
|
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf:
Re-checked exact head fc4c0a683b15 now that the transient actions/checkout network timeout in DWC3/ATC builtin-no-atc has been re-run and all 14/14 CI checks are green:
- The prior
CHANGES_REQUESTEDfinding (duplicateapple_adp_phy_remove()unregistration / lifetime bug) remains cleanly resolved onfc4c0a683b15. - No remaining code or CI blockers; flipping to
APPROVE.
Assisted-by: LLM (Google:Gemini 4 Neon)
|
@DjDeveloperr All three blockers from the review at
Ready for re-review whenever convenient. |
|
Post-merge verification note for merge |
|
Post-merge J616C (
|
What: Real suspend-to-RAM (
deep) on the MacBook Pro 14"/16" M4 Max (T6041, J614c/J616c) at EL2 via a DT-driven T6041 sleep platform driver (t6041-sleep.c), integrating with the shared Apple sleep core, AOP/PMP/SPMI/SMC/PCIe/GPU suspend-resume hooks, and Kahn topological ordering of DT power-domain shutdown/restore lists (ensuringamcc23/amcc19restore beforedcs_23/dcs_19andapcie_phy_sw->apcie_sys_*->ans->apcie_*on entry).Tested: J616C M4 Max 16" (32-core T6041, 26.6.2 firmware, default cmdline,
7.3.0-s2r1664+) exact-head PASS at8e43db29ae7d(rebased ontomain38ffa67c1ec0, 26 commits):deepS2R cycles (rtc1+15sx 5,18seach,rc=0, identicalboot_id,0GPU faults,0failed systemd units, Wi-Fi recovered, post-soakgpubench-vkrender.deferredcrc=2cfe9a54&compute.conv2dcrc=2d55a14dvalid=true,max-health.shPASS) on Aura1.0.0b16-g07ea3332-dirty.deepS2R cycles (rtc1+15sx 3,17seach,rc=0, identicalboot_id,0GPU faults,0failed units) on unmodified stock Aura1.0.0b15-g4a6a093d— confirming no Stage 2 Aura change is required on J616C.t6041-j616c.dtb:ps_off73 nodes (0 DT-edge violations),ps_restore227 nodes (0 DT-edge violations, 22 AMCC/DCS pairs checked, 0 inversions). ARM64 LLVM=1 build clean (checkpatch.pl0 C errors/warnings).Risk: one-way · T6041 Macs (M4 Max J614c/J616c) when entering
deepS2R, plus sharedspmi-apple-controller,macsmc,pmp.rs, andpcie-applesuspend/resume hooks (gated to firmware-driven sleep / T6041 DT properties so non-T6041 s2idle/sleep paths stay unchanged).Not yet: 40-core T6041 (J614c / J616d) and macOS 27.2 firmware (
pmp.rssram_backup/apple,sram-keep) live S2R verification; non-T6041 regression check on T8140 / M5.Details
9c39bb0ec33a..8e43db29ae7d) rebased ontomain(38ffa67c1ec0).8e43db29ae7d): static DT order restoreddcs_23/dcs_19beforeamcc23/amcc19, andps_offrequired strict child-before-parent ordering (apcie_phy_sw->apcie_sys_*->ans->apcie_*). Kahn topological sorting over DTpower-domainseliminates all 22 AMCC/DCS inversions and preserves exact shutdown/restore invariants.macsmchas_wktp/ dark-wake handling andpmp.rsconfig fields cleanly across the rebase.