Skip to content

rtc: apple-pmu: wake s2idle through the alarm IRQ - #1443

Closed
DjDeveloperr wants to merge 2 commits into
fix/apple-sleep-fast-entryfrom
fix/apple-sleep-s2idle-wake
Closed

DjDeveloperr wants to merge 2 commits into
fix/apple-sleep-fast-entryfrom
fix/apple-sleep-s2idle-wake

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

The J700's PMU alarm did not return a suspend-to-idle test. Associate its alarm interrupt with the device wake source and remove IRQF_NO_SUSPEND, so the IRQ core can wake the system before the thread acknowledges the alarm through SPMI. Balance the wake-IRQ association on probe failures and removal.

Also keep explicit s2idle out of Apple platform preparation. The PM core calls the platform begin/end callbacks for s2idle when there are no s2idle callbacks. Begin previously saved pins, armed the deep watchdog and set the firmware-suspend flag unconditionally, causing a debug-link cut and deferred SEP preparation even though s2idle never invokes the platform commit. Gate that preparation on PM_SUSPEND_MEM, clear the stale cut marker in RAM, and disarm WD2 only for the firmware transition that owns it. Keep the PM outcome flags through resume callbacks.

Stacked on #1437 (and #1398), tested on J700 with the Fedora 44 config:

  • Isolated RTC change, fin8: actual 20-second s2idle alarm returned on IRQ 67 with the same boot UUID. The RTC handler replayed after dpm_resume_noirq; the alarm disarmed. PCIe released its s2idle holds with zero refused power-offs.
  • RTC plus state guard, fin9: another actual 20-second s2idle alarm returned on IRQ 67. No SMC debug-link cut, no deferred SEP registration (enabled prepare probe recorded zero calls), no false GPU-before-commit preparation. The fresh boot default was [deep], and the explicit test restored deep.
  • Immediate gateway pings failed in these rows; subsequent pings to the LAN host passed 3/3. Both results are retained, without calling the initial loss fixed.
  • Fin8 also returned a normal 20-second DRAM-kept platform sleep and streamed three complete camera frames with no ISP/DART errors. Camera content validation was dark/uncontrolled, and a later skip-buffer capture timed out; those limits remain recorded.

Only the J700 hardware result is claimed. Other SoCs are not added to the platform driver. The rare-reset and SEP cancellation failures remain separate work; these targeted rows do not replace the retained fin6 40/40 soak or claim final production validation. No raw register probes, input wake masking, long power runs, merges, releases or pin bumps.

Exact source/builds and traces: migration/neo-continuation-20261108/final-validation/{rows/fin8-s2idle.,rows/fin9-s2idle.,rows/fin8-platform-camera.txt,RESULT.md,LIVE.md}.

🤖 Generated with Codex

Associate the retained PMU alarm interrupt with its wakeup source instead of keeping the thread live through suspend. The IRQ core can then report a wake before the alarm is acknowledged over SPMI, and replay the pending interrupt after device resume. Clear the association on all probe failures and removal.

Signed-off-by: Diljit Singh <hey@djdev.me>
The PM core falls back to the platform begin/end callbacks for suspend-to-idle when no s2idle callbacks are installed. Do not arm the platform watchdog, save the platform sleep state or set the firmware-suspend flag for that path. Otherwise device callbacks cut the debug link and prepare for a firmware commit which s2idle never invokes. Only stop the platform watchdog when that preparation ran.

Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr added a commit that referenced this pull request Nov 10, 2026
Add the EL2 platform sleep provider and coordinate the CPU clusters, interrupt
controller, memory, power domains and device firmware across suspend-to-RAM.
Keep the USB host and DRAM when their retained-power path is available, and
restore the camera's complete ISP DART state at each power-up.

Bring the Neo sleep series together with its device resume, refusal, RTC,
radio wake, display, audio, PCIe and debug-link fixes. Keep platform
preparation out of explicit suspend-to-idle and let the PMU alarm IRQ wake
that state. Retain the selected deep default if ANS lacks replay tunables;
the existing readiness check still refuses the unsafe transition.

Preserve the conservative SMC warning and outbox waits. Match only the
measured T8140 provider; other SoCs require their own supported provider.

Consolidated from Diljit Singh's Neo sleep series through the fin6 source
tree, the two standalone RTC/state fixes in #1443, and the isolated ANS
selection policy correction. Integration's AWDL, NVMe crash-session and
RTKit state-query changes are retained alongside the sleep interfaces.

Describe the ISP power-domain tuples separately for T8140 and T8142, with
matching examples. Keep the ATC sleep-result constant available to consumers
when the PHY implementation is unreachable.

Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr added a commit that referenced this pull request Nov 10, 2026
Add the EL2 platform sleep provider and coordinate the CPU clusters, interrupt
controller, memory, power domains and device firmware across suspend-to-RAM.
Keep the USB host and DRAM when their retained-power path is available, and
restore the camera's complete ISP DART state at each power-up.

Bring the Neo sleep series together with its device resume, refusal, RTC,
radio wake, display, audio, PCIe and debug-link fixes. Keep platform
preparation out of explicit suspend-to-idle and let the PMU alarm IRQ wake
that state. Retain the selected deep default if ANS lacks replay tunables;
the existing readiness check still refuses the unsafe transition.

Preserve the conservative SMC warning and outbox waits. Match only the
measured T8140 provider; other SoCs require their own supported provider.

Consolidated from Diljit Singh's Neo sleep series through the fin6 source
tree, the two standalone RTC/state fixes in #1443, and the isolated ANS
selection policy correction. Integration's AWDL, NVMe crash-session and
RTKit state-query changes are retained alongside the sleep interfaces.

Describe the ISP power-domain tuples separately for T8140 and T8142, with
matching examples. Keep the ATC sleep-result constant available to consumers
when the PHY implementation is unreachable.

Compile the real Apple DWC3 object in CI for built-in/module glue with
ATC absent and built-in glue with modular ATC. Assert the resolved Kconfig
values before compilation and retain per-profile compiler/config receipts.

Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr added a commit that referenced this pull request Nov 10, 2026
Add the EL2 platform sleep provider and coordinate the CPU clusters, interrupt
controller, memory, power domains and device firmware across suspend-to-RAM.
Keep the USB host and DRAM when their retained-power path is available, and
restore the camera's complete ISP DART state at each power-up.

Bring the Neo sleep series together with its device resume, refusal, RTC,
radio wake, display, audio, PCIe and debug-link fixes. Keep platform
preparation out of explicit suspend-to-idle and let the PMU alarm IRQ wake
that state. Retain the selected deep default if ANS lacks replay tunables;
the existing readiness check still refuses the unsafe transition.

Preserve the conservative SMC warning and outbox waits. Match only the
measured T8140 provider; other SoCs require their own supported provider.

Consolidated from Diljit Singh's Neo sleep series through the fin6 source
tree, the two standalone RTC/state fixes in #1443, and the isolated ANS
selection policy correction. Integration's AWDL, NVMe crash-session and
RTKit state-query changes are retained alongside the sleep interfaces.

Describe the ISP power-domain tuples separately for T8140 and T8142, with
matching examples. Keep the ATC sleep-result constant available to consumers
when the PHY implementation is unreachable.

Compile the real Apple DWC3 object in CI for built-in/module glue with
ATC absent and built-in glue with modular ATC. Assert the resolved Kconfig
values before compilation and retain per-profile compiler/config receipts.

Reconcile with the merged M5 foundation while retaining outer-consumer
progress, event/report ordering, optional region C and firmware-owned DART
interfaces. Leave all T6050 restart profiles disabled until independently
qualified.

Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr added a commit that referenced this pull request Nov 10, 2026
Add the EL2 platform sleep provider and coordinate the CPU clusters, interrupt
controller, memory, power domains and device firmware across suspend-to-RAM.
Keep the USB host and DRAM when their retained-power path is available, and
restore the camera's complete ISP DART state at each power-up.

Bring the Neo sleep series together with its device resume, refusal, RTC,
radio wake, display, audio, PCIe and debug-link fixes. Keep platform
preparation out of explicit suspend-to-idle and let the PMU alarm IRQ wake
that state. Retain the selected deep default if ANS lacks replay tunables;
the existing readiness check still refuses the unsafe transition.

Preserve the conservative SMC warning and outbox waits. Match only the
measured T8140 provider; other SoCs require their own supported provider.

Consolidated from Diljit Singh's Neo sleep series through the fin6 source
tree, the two standalone RTC/state fixes in #1443, and the isolated ANS
selection policy correction. Integration's AWDL, NVMe crash-session and
RTKit state-query changes are retained alongside the sleep interfaces.

Describe the ISP power-domain tuples separately for T8140 and T8142, with
matching examples. Keep the ATC sleep-result constant available to consumers
when the PHY implementation is unreachable.

Compile the real Apple DWC3 object in CI for built-in/module glue with
ATC absent and built-in glue with modular ATC. Assert the resolved Kconfig
values before compilation and retain per-profile compiler/config receipts.

Reconcile with the merged M5 foundation while retaining outer-consumer
progress, event/report ordering, optional region C and firmware-owned DART
interfaces. Leave all T6050 restart profiles disabled until independently
qualified.

Signed-off-by: Diljit Singh <hey@djdev.me>

Arm SEP wake completion before releasing the held receive IRQ.
This preserves an early wake notification instead of clearing it after
RX has resumed. Native abort recovery and final qualification stay open.
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Superseded by #1445 (merged as 2b05915); its changes are in integration/aurora. See drivers/rtc/rtc-apple-pmu.c.

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