Skip to content

soc: apple: reduce measured debug-link suspend entry waits - #1437

Closed
DjDeveloperr wants to merge 2 commits into
fix/apple-sleep-refused-resleepfrom
fix/apple-sleep-fast-entry
Closed

DjDeveloperr wants to merge 2 commits into
fix/apple-sleep-refused-resleepfrom
fix/apple-sleep-fast-entry

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

A Neo suspend with a live debug cable spent about 2.57 seconds in the debug-link waits before committing. Start polling the contract at 50 ms instead of waiting a fixed second, then require either an observed loss followed by a live PD contract or the previous one-second floor. Keep the existing timeout and reset retries, and log the actual loss/return times. The first poll is not the contract return: fin7 normally reports loss at 50 ms and return around 660 ms.

After the contract returns, shorten the SMC outbox quiet window from 500 to 100 ms and the late slpw-to-slpa gap from 770 to 200 ms. An incoming message restarts the quiet interval. The normal no-debug-link path is unchanged. These are the only two production changes, stacked on #1398.

Built as fin7 (linux-ship2 cd96f70815c8, stage2-15, Fedora 44 distro config), tested on J700:

  • With the original rig port setup, five measured 20-second RTC sleeps kept DRAM and preserved all USB device IDs. Entry-to-commit: four at 1.519–2.325 s and one at 7.334 s when PD recovery needed a second reset. The measured debug-link waits were 1.039–1.233 s normally, versus about 2.57 s before. The retry remains a latency outlier; this PR does not remove that recovery.
  • The outstanding freezer delay was traced separately: hub_event spent the entire 661 ms freezer window warm-resetting the Neo's empty SuperSpeed debug-cable port. The host's matching SS port was already disabled. Disabling that empty Neo SS port through its existing sysfs interface is a rig control, not a kernel change in this PR.
  • With that rig control, five further 20-second RTC sleeps returned, all DRAM-kept, no USB disconnect/reset/re-enumeration. Entry-to-commit 1.335–1.511 s; observed remaining-freezer time 35–70 ms. Do not attribute that separate freezer improvement to the production patch.

The original-setup comparison includes different NetworkManager WoWLAN profile settings; the debug-link interval itself is logged directly. The disconnected-debug-cable latency is not measured here; subtracting the logged rig interval is only a phase estimate.

Evidence: migration/neo-continuation-20261108/final-validation/{rows/fin7-wow,rows/fin7-ss-off,rows/frz9.trace,rows/hubdebug12.trace,RESULT.md,LIVE.md}. Existing fin6 40/40 soak and camera/PMP results remain recorded; this targeted result does not replace that soak or resolve the other reset/s2idle/SEP blockers. No general USB core change, merges, releases, or distro pin bumps.

🤖 Generated with Codex

…r its cut

The cut waited a fixed second after the port controller's cold reset
before its first look at the contract, and in every logged sleep the
contract was already back at that first look. That second was most of
a cut sleep's entry.

Look from 50 ms on instead. The contract reads back as before for a
moment after the reset, so count it as back only once it was seen gone
(no contract, or no answer while the controller restarts), or after the
old second if it never seemed to go. Log both times.

Signed-off-by: Diljit Singh <hey@djdev.me>
A sleep that cuts the debug link waits for the SMC's outbox to be quiet
for 500 ms after the cut, then warns it late and leaves macOS's 770 ms
before slpa. No message came in the quiet window in any logged sleep,
and the sleeps that warn at .prepare, with no cable, commit 150-500 ms
after the warning and run to their alarm (154 of 154).

Use 100 ms of quiet and a 200 ms gap.

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

Copy link
Copy Markdown
Contributor Author

Superseded by #1445 (merged as 2b05915); its changes are in integration/aurora. See drivers/mfd/macsmc.c and drivers/soc/apple/sleep.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