Repository navigation
Conversation
… build The paired mode set (a mode too wide for one engine, run on two) sends its IOMFB calls through dcp_peer_video_call_stream(), naming them by their 27.0 IDs. Firmware 27.2 renumbered the IOMobileFramebufferAP methods, and an ID the firmware does not know panics it: on a 27.2 stub the paired prepare's set_display_device went out as A411 and crashed both engines. Translate each call's ID through the engine's build-selected table (iomfb_v27_tag()): a method the tables name takes this build's ID, and on 27.2 another A4xx ID (A449) moves up by 50 with the rest of IOMobileFramebufferAP. Other IDs, and every ID on 27.0, are sent as before. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
Besides the paired calls, the firmware 27 paths name some calls by their 27.0 IDs: the primary's paired mode set (A413) and power step (A484), the paired background swap (A408), the sleep's power and A500 steps, the display stage calls and A442. On 27.2, which renumbered IOMobileFramebufferAP, several of those IDs are other methods: the paired mode's power step ran one and failed, and the second engine of a 4K240 mode never started. Translate each of them through the engine's build-selected table (iomfb_v27_tag()). The J714s's A407 swap keeps its ID, which only its 27.0 table names, and its diagnostic now refuses a pair whose engines take different swap forms. 27.0 sends what it sent. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
The J716c's display processors take part in a deep sleep through the
firmware 27 endpoint transport, which was admitted on a 27.0
compatibility build only. On a 27.2 stub no processor registered for the
sleep, and every deep sleep was refused ("display 0: no provider").
Admit 27.2.0 as well. Its endpoint transport is the 27.0 one, and the
IOMFB calls the sleep makes are sent with the build's IDs.
Developed with Claude Code.
Signed-off-by: Erik Bourget <erik@ebourget.net>
1e538de to
dda6aa0
Compare
|
Thanks for putting the 27.2 sleep together as one series; the testing write-up is very useful. Our convention is to select behaviour by a hardware or firmware property, not by the list of boards it was tried on, and the admissions extend those lists with Two of them carry firmware behaviour: the ANS log buffer under the hold ( For the admissions, could the SoC sleep data or a DT property on each node (for example the sleep description itself) select them? A generic name instead of |
|
Thanks for putting this together as one series. #2075's findings are all covered here. A review note on how the new behaviour is selected, before this merges. Most commits add
None of this changes what the K116s does at runtime. It changes which other T6050 boards pick it up. |
|
One addition to the notes above, so the hardware side is clear as well. The 30 s RTC sleeps cover the alarm path; the series also makes lid and keyboard wakes possible (
On the selection point: #2089 changes the T6050 sleep entry's machine string to The rtkit, dcp and |
A driver built as a module needs it to complete its own node at probe: the Apple display driver adds a mailbox that the boot loader must not see in mboxes. Signed-off-by: Jens Axboe <axboe@kernel.dk>
dda6aa0 to
ea096dd
Compare
|
Ryan, thanks for the review. The series is reworked along those lines; the branch is force-pushed as v2. Nothing in it names the K116s in a driver any more, and the K116s does the same things at run time as before. How the paths are selected now
What this changes on other boards
Where I would like your view
Checks checkpatch is clean except the Test row K116s, firmware 27.2. Kernel for the first two items:
Since 2026-11-16 the journal has 113 deep-sleep wakes on this machine across the heads of this work: 75 by RTC alarm, 17 by the lid, 18 for the charger, 2 for Wi-Fi/Bluetooth and 1 by the power key. |
|
Thanks for v2, this is a big step: the board lists are gone from most drivers, the PMP CoreAnalytics ack now follows
Row still open at the v2 head on the K116s: three lid close/open sleeps with no alarm armed and three power-key wakes, each with the same post-resume checks as your rtcwake runs. Bluetooth can stay out since the machine does not use it. Thanks for the charger-wake numbers; we will look at the dark-wake series when it is up. One more K116s row, beyond this PR: SIO is still enabled only on the J714s ( |
A coprocessor with a second (secure) mailbox port takes its IOP idle only after that port's AP idle, sent between the main mailbox's AP idle and its IOP idle. The display coprocessor of T6050 firmware 27.2 is one: without it the IOP idle is never acknowledged. - apple_rtkit_v27_set_after_ap(): a callback the atomic idle runs once the AP state is acknowledged, before the IOP request. An error from it fails the idle. - apple_rtkit_v27_port_ap_idle_atomic(): a port's AP idle, sent and awaited by polling, for that callback. - apple_rtkit_idle_strict_with(): the same step for the sleeping idle. No caller yet. Signed-off-by: Jens Axboe <axboe@kernel.dk>
27.0's A442 takes 0xaa filler after its key. 27.2's A492 reads an index count and a block size there and rejects the call (its syslog shows idx_count 0xaaaaaaaa). Send zeros, which it accepts. Run on a K116s (16-inch M5 Pro, 27.2): the internal DCP and the four DCPEXT sleep and wake with it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
On T6050 firmware 27.2 the internal display coprocessor has a secure mailbox port (ADT /arm-io/dcp-exclave-mailbox, iop,secure-rtbuddy-proxy), as on T8140. With it unanswered the firmware acknowledges the AP idle and never the IOP idle: the sleep's late stop fails, and so does the stop and restart in the wake. - The port may be named by apple,secure-mbox where mboxes must stay the one ASC mailbox: the boot loader refuses the display handoff otherwise. It is added to the live node's mboxes at probe. - A coprocessor with the port is no longer refused the V27 sleep. Its poller stops at .prepare. - Late stop: the port's AP idle between the main mailbox's AP idle and its IOP idle, polled, interrupts off. Not acknowledged in 5 ms, it fails the stop. - Wake: the stop and restart cycle idles the port the same way and stops its poller, which otherwise reads the mailbox with the display's domain off (SError). The port is restarted before RUN and turned on after the boot. All of it follows the port's presence, not the board. Tested on a K116s: with this the IOP idle is acknowledged within 2 ms. Signed-off-by: Jens Axboe <axboe@kernel.dk>
An endpoint that is still taking a message answers -EBUSY to the close
for a moment, and the sleep was refused; undoing it then crashed the
internal DCP. Seen on endpoint 0x31 of a K116s DCPEXT, where a service
is announced late ("close-31 -16"), more often with a verbose console.
Poll afk_v27_sleep_check() for up to 300 ms first, as the other steps
do.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
After a V27 sleep the first mode set of the internal panel is kept, not sent: on the J714s (27.0) the firmware brings link and mode back once frames arrive. That mode set also comes before the firmware has announced the panel's video interface again. On firmware 27.2 it now waits for two events of the wake and is then sent: the open of the panel's video interface (up to 1.5 s) and the firmware's hotplug report that follows it (up to 250 ms). A wait that runs out is logged. On the K116s the firmware answers that the mode is already set and the link up. 27.0 keeps the mode as before. Whether 27.2 needs the mode set has not been tested separately. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The T6050 ANS wake holds the buffers: a request under the hold fails the wake with -EBUSY and the driver then holds all I/O. ANS on firmware 27.0 asks for none. On 27.2 it asks for its syslog buffer (endpoint 2, 0x4000 bytes) about 2.4 s into the wake, having none yet. A first buffer for an endpoint replaces nothing the hold protects: serve it. A request for an endpoint that has a buffer is refused as before. With it ANS comes back and the controller is rebuilt after a deep sleep on a K116s (27.2). Signed-off-by: Jens Axboe <axboe@kernel.dk>
The T6050 entry refuses a sleep unless the PMU's RTC alarm is armed and
unmasked ("SoC check: -16"), so a lid close with no alarm set never
sleeps. The alarm is one wake source among several: the SMC wakes the
machine for the lid and the keyboard without it.
Accept a sleep with no alarm armed. The alarm is then not held against
the sleep timer in the final check and not rearmed after the commit.
With an alarm armed nothing changes.
Tested on a K116s: deep sleep with no alarm, woken by the lid.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
The drivers that take part in T6050's firmware-driven sleep each name the boards it has run on. Whether a board sleeps that way is in its device tree: it has an enabled apple,t6050-sleep node or it does not. Add apple_t6050_sleep_described() for that. What differs from one description to another is a property of the node, read with apple_t6050_sleep_property(). Signed-off-by: Jens Axboe <axboe@kernel.dk>
The drivers tell one T6050 sleep description from another by the board or by the node's compatible. What differs for the display coprocessors is how they take the sleep: through their firmware 27 method table, with the panel's AV and DP services, or through the sleep's endpoint transport alone. Say so in the description. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The bits of the SMC's wake record are numbered per board: the ADT's smc-pmu node gives each a name (event_name-bitN). Let the device tree carry the bits and their names. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…C's wake reasons Both were tied to the board's name in the drivers: the display coprocessors' sleep through their firmware 27 method table, and the numbering of the SMC's wake record. Describe them, the latter as the J714s ADT's smc-pmu node has it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
A profile that names a machine is refused at probe on any other board, whatever its CPUs. The node's compatible already chose the profile, and what the entry depends on is the inventory: the boot CPU's MPIDR and the CPU count. Check those alone. The K116s (16-inch M5 Pro) binds apple,t6050-sleep with the J714s's 18-core layout and sleeps with that profile. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…ibed The save and restore for T6050's deep sleep are set up on a list of boards. Set them up wherever the device tree describes that sleep. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The saved-context lane is for T6050's deep sleep and was enabled on the boards named here. Enable it wherever the device tree describes that sleep. The J714s's numbering of the wake record was a table picked by the board's name. It is the ADT's smc-pmu numbering: read it from the SMC's node (apple,wake-reasons, apple,wake-reason-names). Without them the SoC's table is used as before. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…ny board The empty CoreAnalytics event on the PMP's endpoint 7 is acknowledged on the J714s only. It is the firmware's doing, not the board's: a K116s's PMP sends it too, on the same endpoint. Acknowledge it for every registry-v2 PMP. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The T6050 description, which stops the SIO at the sleep's commit, was in force on the J714s by name. Follow the device tree: the boards that describe the sleep. The J716c describes it and leaves its SIO disabled, so nothing changes there. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…ibed The attachment was made on two boards by name. Make it wherever the device tree describes T6050's deep sleep; the node's own properties still decide the rest. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…cribed The host registered for T6050's deep sleep on two boards by name. Register wherever the device tree describes that sleep. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The display DARTs' V27 provider was admitted on two boards by name and the ISP DART's sleep on one. Take both wherever the device tree describes T6050's deep sleep: the sleep takes the ISP DART's stream registers on any of them. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…ep is described The rules were in force on two boards by name. Apply them wherever the device tree describes T6050's deep sleep. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The dwc3 glue and the port controllers took T6050's sleep rules on the boards named in each. - dwc3 and the SN201202x's lines and retried start: wherever the device tree describes T6050's sleep. The retried start was the J714s's alone. - The system power state command's rules: every controller with apple,sleep-ssps, which is what makes it send the command around a sleep. This drops the J813 and J815 from the list too; the J700's controllers have the property and now take the rules. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The wrapped provider for T6050's deep sleep was used on two boards by name. Use it wherever the device tree describes that sleep. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…ription The V27 sleep's paths for the internal panel (the 27.0 method table with the sleep call and the A407 swap, the panel's AV and DP services) and what the external processors gained around it were in force on the J714s by name. Follow the device tree: a sleep description with apple,display-method-sleep. The J716c's has none and keeps its endpoint transport. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Describe the RTC of the PMU on nub-spmi0, as the J714s does: the registers are the T6041 PMU's, at the addresses this board's ADT gives. It is a second RTC beside the SMC's and the only one with an alarm. The PMU raises no alarm interrupt on this SoC, so the alarm is a wake source for a firmware sleep only. Signed-off-by: Jens Axboe <axboe@kernel.dk>
iBoot leaves VENC0_SYS on (PS word 0xf0003ff). Its node is disabled on the K116s, so nothing ever turns it off, and FAB0_SOC stays up behind it. The J714s enables these power states for its encoder. With VENC0_SYS on, the SoC does not enter the firmware-driven sleep: the whole entry runs, and the machine resets about 5 s after the commit word. macOS has VENC0_SYS off at its commit on this board (register state read with macOS as an aura guest, the commit withheld). Enable ps_fab1_piogw (firmware-owned), ps_fab0_soc (always-on) and the ps_venc0_* states as on the J714s. Unused, genpd turns them off at boot. No encoder is described yet. Tested on a K116s: venc0-sys and its children read off after boot, and the J714s commit sequence then sleeps. Signed-off-by: Jens Axboe <axboe@kernel.dk>
…ional The SoC values file ends with the J714s's USB4 router sleep (acio2, its DART, the clock protection syscon), which needs nodes only t6050-max.dtsi has. A board that includes the SoC values without that router defines T6050_SLEEP_SOC_NO_CIO first. No change for the J714s. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The internal DCP of a T6050 on firmware 27.2 has the secure port T8140's has (ADT dcp-exclave-mailbox, iop,secure-rtbuddy-proxy). Signed-off-by: Jens Axboe <axboe@kernel.dk>
…p-pins Without the property no pin is saved. A board whose ADT names no pin to leave alone, the K116s, has every pin saved: the property is there and empty. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The boot loader hands the display over only to a node whose mboxes is the one ASC mailbox. A machine whose internal DCP has a secure port names it in a property of its own there, and the driver takes it as the "secure" mailbox. Signed-off-by: Jens Axboe <axboe@kernel.dk>
The J714s's sleep controller description and SoC values on the K116s (16-inch M5 Pro, firmware 27.2), with what differs on this board: - apple,pinctrl-skip-pins is empty: the K116s ADT's gpio0 has no no-restore-gpio-pins. With the J714s's list the panel stays dark after a deep sleep. - The display coprocessor's secure mailbox (ADT dcp-exclave-mailbox), named by apple,secure-mbox so that mboxes stays the one ASC mailbox for the boot loader. - The MagSafe port's PD controller (hpm5), so that the sleep puts it in S3. - dcpext0 without its Type-C route, as dcpext1 to 3: the engine must bind for the sleep to stop its firmware. - apple,sram-keep <0x56000 0x9b000> for the PMP: its __DATA starts at 0x56000 on 27.2 (ADT segment-ranges). With the J714s's range the PMP does not come back from the sleep. - The four clock words are parked with 0x80100000, as macOS does on this board (J714s: 0x80100400). - apple,panel-video-open-delay-us 10000: the panel's plug takes about 2.9 ms here, and with 2500 us the open landed before the firmware's close. - No CIO sleep part: no USB4 router is described. - apple,display-method-sleep and the SMC's wake reasons, as on the J714s: the K116s ADT's smc-pmu node numbers them the same way. Needs a boot loader that hands the four DCPEXT to the kernel on 27.2 (aura with ext = true for the V27_2 images) and publishes the S2R mailbox. Tested on a K116s: sleep and wake by RTC alarm and by the lid, several cycles a boot, and one sleep of 7.7 hours; display, NVMe, Wi-Fi and Bluetooth work after the wake. The values taken from the J714s (commit schedule, SMC policy, MCC and clock sequences) have not been checked against this board one by one. Signed-off-by: Jens Axboe <axboe@kernel.dk>
ea096dd to
4a72ae6
Compare
|
Ryan, thanks. v3 is pushed; point by point: 1. One predicate.
One thing I left: 2. SMC wake reasons. 3. Wake mode set. Two completions in place of the poll and the
A wait that runs out logs a warning and the mode set is sent anyway. In three v2 wake logs the report follows the open by 5 to 16 ms. One caveat: the 40 ms also covered about 20 ms of firmware set-up that follows its hotplug notify in the syslog, so this sends the mode set earlier than v2 did. At the v3 head neither wait ran out in five wakes, and the panel was on after each; in the one I timed the report came 5 ms after the open and the mode set request followed at once. 4. 5. SPMI, tipd.
What changes on other boards, v3 against v2
Checks
Tests at the v3 head (K116s, firmware 27.2,
I did one lid and one power-key wake, not three of each, on purpose. The sleep and wake path does not depend on what wakes the machine, and everything v3 changes in it ran in the Link the SIO branch when it is up and I will boot it and post the two logs. |
|
Thanks for v3; one predicate, the wake reasons in the DT, the completions, and failing the unacknowledged idle all read right. On your question: yes, please give |
The platform's limit on merged modes belongs to the external display coprocessors of a machine, not to its sleep. Give it a property of their nodes. Signed-off-by: Jens Axboe <axboe@kernel.dk>
… display coprocessors The driver applies the limit on the J714s. Say so on its four external display coprocessors, for the driver to read. Signed-off-by: Jens Axboe <axboe@kernel.dk>
dcp_peer_limit_applies() rode on dcp_j714s_ext(), which follows the sleep's description now. The limit is of the display engines, not of the sleep: read apple,merged-mode-limit from the coprocessor's node. The J714s sets it, so nothing changes there, and no other board takes the limit. Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
Ryan, thanks. v4 is pushed: three commits on top of v3, nothing else changed. The merged-mode limit. USB-C re-enumeration. One Checks on v4. Builds; checkpatch clean on the three commits; Sequencing. #2440, #2441 and #2442 cover the selection commits here with the same helper. If they go first, I will rebase this onto them and drop the duplicates, which leaves the 27.2 pieces, the bindings and the K116s tree. Say which order you want. |
|
As promised, the branch that widens SIO and the PMP CoreAnalytics acknowledgement from the J714s to every T6050 board (keyed on the hardware instead of the board name) is #2412 (draft). A boot of it plus |
Thomas, this is the 27.2 sleep as one change, as asked for on #2070. It sits on #2187, which brings the 27.2 call numbering and the 27.2 sleep transport for the J716c; the first commit here that touches the display assumes it. The branch is based on #2187's head, so its three commits show up here until it is merged; the 34 after them are this series.
With this series the K116s enters the firmware-driven deep sleep and wakes by RTC alarm or by opening the lid, with panel, NVMe, Wi-Fi and Bluetooth back.
What is in it
v4 (2026-11-19): the merged-mode limit gets its own property on the external display coprocessors (three commits on top of v3).
v3 (2026-11-19): second round of review: one predicate, the SMC wake reason names in the device tree, the wake mode set on firmware events, our SPMI commit dropped for #2309. v2 removed the board lists. See the comments below for what changed.
Firmware 27.2 pieces
dcp-exclave-mailbox). While nothing answers it, the firmware acknowledges the AP idle and never the IOP idle. The port's AP idle now goes between the two, at the late stop and in the wake's stop/restart cycle. RTKit gets a hook for that step (apple_rtkit_v27_set_after_ap(),apple_rtkit_idle_strict_with()), andof_update_property()is exported so the driver can add the port to its live node.Selection by the sleep's description
A helper tells whether a T6050 machine describes the sleep in its device tree (an enabled
apple,t6050-sleepnode), and the drivers use it in place of their board lists: sleep controller, AIC, SMC, RTKit (PMP), SIO, NVMe, PCIe, DART, the combo PHY, dwc3 and the port controllers, the GPU, and the display driver. The CPU topology check uses the CPU inventory alone.Device tree and bindings
The PMU's RTC, the video encoder's power states (VENC0_SYS left on by iBoot blocks the sleep), an
#ifndefso a board without the USB4 router can include the J714s's SoC values, and the K116s sleep description. Only the last commit enables the sleep.Testing
K116s, firmware 27.2. Kernel:
integration/aurora0abc2f3 + #2187 + #2309 + this series + my other K116s commits.Known gaps
exception.c:59) in 1 of 38 wakes. Not understood.apple,secure-mboxnames the DCP's secure port apart frommboxes, because the boot loader hands the display over only to a node with a single mailbox. Its binding is added here, with the T6050 secure port's compatible and the empty form ofapple,pinctrl-skip-pins.For #2070
With this in,
v27_sleep_knowncan admit 27.2 on a T6050 whose internal DCP has the secure port described. 27.3 stays unknown.