Repository navigation
Conversation
dcp_is_t8132_ext() decides two things: which T8132 dcpexts the M4 26.6.2 backend (iomfb_m4.c, t8132_ext_drm.c) adopts, and how a T8132 dcpext's display hardware is driven. Since a dcpext handed over with the 27.2 image runs the firmware-27 backend, it is false there, and the hardware decisions went with it: the Air's dcpexts on 27.2 take Thunderbolt DP tunnels as T602X/T8142 pipelines would. Their DP IN pixel clocks are then not limited to the dcpext's own sources (2 and 4) and are started from source 0, the crossbar's DP IN output is never pointed at the dcpext at DCP's Activate, and the crossbar is brought up and down around a link configuration without the DP IN handshake the T8132 output needs. Add dcp_t8132_ext_hw(), any T8132 dcpext whatever backend drives it, and take the hardware decisions with it: - the tunnel pixel clock sources a route may use, and the clock source its SetLinkRate starts (dcp_route_tunnel_clock_blocked(), dcp_route_clock_rate(), dcp_tunnel_set_rate()); - the crossbar's DP IN selection at Activate, its link-up at DidChangeLinkConfiguration and its link-down around a new link configuration (dcp_tunnel_dpin_activate(), dcp_tunnel_crossbar_up(), dcp_tunnel_crossbar_down()); - a route's PHY without DP alt mode (dcp_typec_route_no_dp_alt()), the crossbar output brought up with the link (dcp_direct_crossbar_link()) and the dcpext's lack of tiles (dcp_typec_port_untileable()). dcp_is_t8132_ext() keeps everything of the M4 backend: its probe, teardown and sleep, its DRM hotplug (also for a refused tunnel clock, which on firmware 27 the pipe's own connector follows), its late teardown answers, its readiness and its connector-less ports. Nothing changes on 26.6.2, where every T8132 dcpext is both. A J773g dcpext on 27.2 drives only its fixed HDMI output and has no Type-C route, so the route and tunnel decisions never reach it; its direct crossbar link is the T6041 firmware-27 one as before. The host replays model both predicates: the tunnel clock sources hold on either backend (a mutation back to the M4 predicate fails), and the crossbar union replay covers a J713 dcpext on 27.2. Signed-off-by: Erik Bourget <[email protected]>
A T8132 dcpext on firmware 27.2 is a pipeline of the DRM device, with a connector, so a Thunderbolt DP tunnel routed to it was connected inline: dcp_fabric_run_attach() runs the DPTX connect from inside apple_dcp_tb_dp_tunnel(), under the fabric lock, and the connect waits up to two seconds for the firmware's link configuration. The tunnel's provider waits in that call all the while. A CalDigit TS5 replaces its DP IN request right after the first one (a new cookie): the provider retires the first binding's admission at once but can hand over the new request only after the call returns. DCP's Activate, 2 ms into the connect, then reached the retired binding, which refused it (-ESTALE): the DP IN never woke, no link configuration came, the connect timed out and its Deactivate was refused the same way. The dock's display stayed dark. Connect any T8132 dcpext's tunnel from the Type-C reconnect work, as the M4 backend's and the T6030 external processors' already are: the provider's call returns at once, it hands over the dock's new request, and the firmware's Activate meets the binding the fabric admitted. A pipeline of the DRM device starts its Type-C attachment there as the inline connect did (dcp_typec_attach_deferred(): its generation, cable, firmware metadata and relink state), and queues the connect for the session it started. Without a connector it still connects nothing. Other processors keep connecting inline, and the M4 backend's dcpext queues its connect as before. The new host replay runs both firmware backends through the attach and the Activate: the tunnel connects from the work, a pipeline of the DRM device starts its attachment, the crossbar's DP IN output is pointed at the dcpext before the DP IN handshake and a replaced binding touches nothing; each mutation back to the M4 predicate, or dropping the attachment, fails it. It runs with the host tests. Signed-off-by: Erik Bourget <[email protected]>
A T8132 dcpext selects its tunnel's DP IN output on the crossbar at DCP's Activate (dcp_t8132_tunnel_route_xbar()). When the Activate never comes, or is refused, the route is released with the output never selected, and dcp_typec_route_deactivate() asks the crossbar to idle it with apple_dpxbar_preselect(). The T8132 crossbar has the T602X register map and no preselect: it answers -EOPNOTSUPP, which the release kept as the route's deactivate_error. The route stayed owned with that error for good: every later tunnel request on the port first releases the retired route and fails with it, so after one failed tunnel bring-up every dock replug is refused with -EOPNOTSUPP until a reboot. The T8132 crossbar holds an output's ATC domain and writes its mux only while the output is selected (runtime PM): an output never selected is idle already. Take -EOPNOTSUPP for one as success, as for the T8142-layout crossbars. Signed-off-by: Erik Bourget <[email protected]>
…take On a machine with ordered dual-stream docks, each Type-C port has a primary and a secondary connector, and the secondary, a dock's second stream, is fixed to one Type-C-only pipeline: the lowest-indexed one. The pairing pass and the tunnel candidate hand a stream only a pipeline its connector is offered. That rule assumed a hybrid (a pipeline with an HDMI output) in front, as on the M2 Pro/Max laptops, where the primary stream takes the hybrid and the Type-C-only pipeline stays for the secondary. Where every pipeline of a port drives Type-C only, as the two dcpexts of the M4 MacBook Air and 14-inch MacBook Pro on firmware 27.2 (pipelines of the DRM device there), the lowest Type-C-only pipeline is also the lowest candidate, the one the primary stream is paired with. The secondary connector was offered that pipeline alone, so a dock's second stream never had one while its first was up: the pairing pass planned nothing for it, and once a compositor owned the display the tunnel candidate refused the other, free dcpext because the secondary connector does not offer its CRTC. Thunderbolt kept logging "dpin1: no display pipeline free; waiting for one" and retrying, and the second monitor of the dock stayed dark. Give the secondary connector the lowest Type-C-only pipeline above the port's lowest candidate, and the lowest Type-C-only one where there is none above it. With a hybrid in front that is the pipeline it had before; on those M4 machines it is the second dcpext. Nothing changes where the ordered policy does not apply (T6030, T6050, single-stream wiring), nor on firmware 26.6.2, where the M4 backend drives the Air's dcpexts with DRM devices of their own and the main device has no connector for their ports. The new host replay runs the production pairing pass and tunnel candidate on both layouts: a dock's two streams on either port, in either order, with and without a compositor, each get a pipeline of their own there, and a lone Type-C-only pipeline stays the secondary's. The rule before this change, and each other mutation, fails it. Signed-off-by: Erik Bourget <[email protected]>
When the pairing pass or the tunnel candidate has no pipeline for a DP tunnel, the tunnel's provider only logs that it waits for one, once, and retries every few seconds. Which filter refused the stream was left to kprobes. Say it at debug level, with the error, whether the connector order or a compositor's decided, the planned pipeline and the CRTCs the stream's connector is offered. Signed-off-by: Erik Bourget <[email protected]>
…ect or power-off The swap watchdog retires a present the firmware accepted and dropped (an external pipe that is not enabled accepts presents and drops them), so that the IOMFB queue goes on. A present in flight when a dock goes was not covered: the desktop turns the CRTC off, and the power-off stopped the watchdog. Such a present held the queue for ten seconds, until the queue's timeout declared the processor crashed, and that pipeline lit no display again: after a dock replug on firmware 27.2, one of its monitors stayed dark (IOMFB transaction timed out ... present=1 accepted=1). On firmware with the IOMFB queue, keep the watchdog of a present the firmware accepted and has not completed at the Type-C disconnect and at every CRTC power-off, arming it again if it was stopped (dcp_swap_watchdog_keep()). A power-off with no such present stops it as before. This applies to every queue-backed CRTC, the internal panel and fixed HDMI outputs included: a present of theirs that does not complete within the watchdog period is then retrained as on a Type-C output. Also arm the watchdog on a pipeline with Type-C routes and no fixed connector while no route is selected (dcp_swap_watched()). The dcpexts of J713, J715 and J604 declare a USB-C connector and are Type-C outputs with or without a route, so this reaches only pipelines without a fixed connector. On firmware without the queue such a pipeline is now watched as a routed one is, and nothing is kept across the disconnect or the power-off. The display and lifecycle selftests cover the unrouted pipeline, and the power-off with a present in flight. Signed-off-by: Erik Bourget <[email protected]>
…rmware answers
A T8132 dcpext on the M4 backend takes its display as released when the
firmware refuses or does not answer the release in time: the route of a
tunnel that is gone must not stay owned, or the next tunnel's setup
fails on the same release. The same hardware on firmware 27.2 did not:
after a dock replug whose DP IN Activate was refused, the dcpext's HPD
low and release timed out (-110), the disconnect returned that, and the
fabric kept the retired route. Every later tunnel request on the port
first released it again and failed the same way ("display teardown
failed: -110", "DP tunnel setup failed: -110"), until a reboot.
Release the display of any T8132 dcpext so (dcp_t8132_ext_hw()): any
error of its release, refused or timed out, is logged and the display
taken as released, and any error of the firmware-27 one's HPD low is
logged and the disconnect goes on to the release. Neither waits for or
records an answer still to come on firmware 27. The M4 backend keeps its
own HPD low, which lowers only the HPD its connect raised, and its link
and orphan handling. Other processors keep a refused release.
The Type-C reconnect work connects the next tunnel's display. For a
firmware-27 T8132 dcpext it still tries up to DPTX_RECONNECT_RETRIES
times, a DPTX_RECONNECT_DELAY apart; a failed try is logged with its
number.
A Deactivate after the tunnel went finds the DP IN adapter idled by the
tunnel's teardown already (-ESTALE): on every unplug, so debug only.
Signed-off-by: Erik Bourget <[email protected]>
…re 27 Compile the production bodies a firmware-27.2 T8132 dcpext's dock displays depend on against host mocks and replay an unplug with a present in flight and a replug: the swap watchdog of a pipeline with Type-C displays only (a present taken for a display that went is watched, before and after its route is released and across the CRTC's power-off), and the display release of a firmware-27.2 T8132 dcpext that does not answer. Pipelines with a fixed output, the internal panel, firmware without the IOMFB queue and other processors' releases keep what they had. Three negative controls each put one piece back as it was; each must fail the replay. Run with the host tests. Signed-off-by: Erik Bourget <[email protected]>
A T8132 dcpext's Thunderbolt DP tunnel has no DP PHY lanes to check: the lane count the firmware sets is the tunnel's. set_active_lane_count took that exception only for the M4 backend (dcp_is_t8132_ext()), so a firmware-27.2 dcpext logged "unexpected lane count" on every valid lane count increase of a tunnel. It is a hardware fact: decide it with dcp_t8132_ext_hw(), as the other T8132 hardware decisions are. Two comments follow the split of the predicates: - the no-DP-alt-mode route no longer says the dcpext is no apple_crtc pipeline, which is true of the M4 backend only; - the 5-6 ms between the T8132 crossbar's link-up and the DP IN set active again, which firmware 27.2 now also reaches, says what it is: the T602X-map crossbar reports no link state to wait for, the interval is the one the T8142-layout link-up uses and the T8132 tunnel has run with on both backends, and no shorter one has been measured. The rate selftest's fixture models the predicate. Signed-off-by: Erik Bourget <[email protected]>
… can reach The previous change fixed an ordered secondary connector to one Type-C-only pipeline, the lowest one above the port's lowest candidate. That breaks when the first stream has to take that pipeline. With a display on another port holding dcpext0, a dock's first stream takes dcpext1. When the other display goes and the dock's second stream comes, dcpext0 is free and can drive it, but the secondary connector offers only dcpext1, so the stream is refused (-EBUSY). Before the change it took dcpext0. No single fixed pipeline serves both orders. Offer the secondary connector every Type-C-only candidate whose route can carry the second stream: a pixel clock for its DP IN and a crossbar control feeding it (dcp_typec_port_carries_stream(), the checks the tunnel candidate makes). A compositor that reads possible_crtcs once then has a set holding every pipeline the stream can be given, whichever one the first stream took. Where a hybrid comes first (M2 Pro/Max laptops) the set is the one Type-C-only pipeline as before. A port whose second stream reaches no pipeline keeps the Type-C-only set, on which its tunnel is refused. The order between the streams is kept by the allocation instead: while the first stream has no pipeline, the second keeps off the port's lowest candidate, the one the first takes when both are free, as long as it is offered one above (dcp_fabric_second_yields()). The tunnel candidate ranks that pipeline last, and the pairing pass plans the second stream on it only when nothing above it is left for it. The replay adds the sequence above and the reverse order, with either pipeline busy first, a pipeline that cannot clock the second stream, the hybrid busy then free, and a pass that must fall back to the first stream's pipeline. Every assignment is checked against the masks as read at probe. The previous rule, the rule before it, and each other mutation fail it. Signed-off-by: Erik Bourget <[email protected]>
The earlier change to the swap watchdog did more than its case needed, and missed a race in it. - The dcpexts of the M4 MacBook Air and 14-inch MacBook Pro declare a USB-C connector, so they are Type-C outputs with or without a route, and their presents were watched after the route went. Arming the watchdog on any pipeline with Type-C routes and no fixed output (dcp_swap_watched()) reached only other machines. That rule is dropped. - The power-off read whether a present was in flight without the IOMFB queue's lock. The firmware's acceptance, which arms the watchdog, can run between that read and the cancel, and the cancel then stopped the watchdog of the very present that would not complete. - The power-off kept the watchdog of any queue-backed CRTC with a present in flight: the internal panel, a fixed HDMI output, a Type-C display still attached. On expiry the watchdog invalidates the mode and queues a hotplug on the pipeline's connector, which by then can hold a display plugged in after the timed-out present. iomfb_present_lost() now marks the present in flight lost and keeps its watchdog, under the queue's lock, where acceptance and completion run. The Type-C detach calls it, and so does the power-off of a CRTC whose display was unplugged since its power-on (the case that leaves the connection alone). Every other power-off stops the watchdog as before. The watchdog retires a lost present and only completes its flip: no mode is invalidated and no hotplug is queued. A present accepted later belongs to the current display and is retrained as before if it does not complete. The replay now runs the production watchdog, its retirement and the power-off. It covers a lost present retired after a replug without touching the new display, acceptance just before and just after the power-off takes the lock, a present completed or aborted after a replug, and panel, fixed HDMI and attached Type-C DPMS. Each of six mutations fails it. The display and lifecycle selftests follow. Signed-off-by: Erik Bourget <[email protected]>
…answered The release change took every release error of a firmware-27 T8132 dcpext as done. That includes a release that was never sent (-ENOSPC), a refusal, and errors on a live link or a fixed one (J773g's HDMI output, DPMS), where no tunnel has gone. On a timeout, the firmware-27 transport keeps the call's slot for its late reply, but the next connect could start at once. The firmware's Deactivate and lane-count calls carry no binding cookie, so a late Deactivate of the old release could idle the replacement's DP IN, and a late lane report could satisfy its link wait. Take a release as done only when it timed out for a display whose Thunderbolt tunnel is gone, that is when its provider has revoked the binding (dcp_t8132_tunnel_gone()), and only to hand the route back. Any other error is returned, as on every other path. An HPD low follows the same rule. Such a release marks the port held: - afk_late_replies_pending() covers a firmware-27 call whose slot waits for its late reply, as well as the M4 backend's compact orphans, and the late reply wakes its waiters; - meanwhile the firmware's Activate, Deactivate and link calls, and now also its lane-count and hotplug-detect reports, are taken as the old release's and not acted on; - the next connect waits for the answer. The answer ends the wait, and so does the session's revocation (the detach wakes it) or the CRTC's power-off. Without an answer after DCP_T8132_ORPHAN_WAIT, the M4 backend gives up on its orphans as before. On firmware 27 the port stays held and the connect fails, because the firmware still owns that call. The wait no longer polls in 50 ms slices, and afk_compact_orphans_wait() loses its last user. The AFK and selftest fixtures follow, and the AFK v2 send test checks that only the late reply of a timed-out call wakes its waiters. Signed-off-by: Erik Bourget <[email protected]>
…ned off The deferred connect of a T8132 dcpext's tunnel checked the fabric session alone. A tunnel's provider revokes its binding before the fabric retires the session, so the work could still send DPTX calls for a revoked binding and reach the refused Activate that deferring the connect was meant to avoid. The detach waits for the work under the fabric lock, so a replacement tunnel also waited behind the old one's two-second link wait. The connect passed recovery=false, so a CRTC turned off (typec_crtc_off, set without hpd_mutex, with the work cancelled without waiting) could still get HPD raised by a connect already running. Failed connects were retried five times, a second apart, whatever failed them. - Before each DPTX call, the connect checks the provider's admission of the session's binding as well (dcp_connect_admitted_locked()). - The detach completes a tunnel's link wait, so that a connect of the revoked session finds it revoked at once. - A deferred attachment queues its connect not to wake a CRTC turned off (typec_reconnect_recovery). The power-off sets typec_crtc_off under hpd_mutex, where the connect checks it before each call. An HPD that the connect raised before is the power-off's to release. - A T8132 dcpext connects once per tunnel on either firmware, as the M4 backend did. A replaced or revoked binding, a link that did not come or a release still unanswered is not changed by trying again. The tunnel's next request, or the CRTC's power-on, connects again. The new replay compiles the production reconnect work, connect, session and admission checks, release wait, detach and release. It revokes the binding before the work, between two DPTX calls and during the link wait, turns the CRTC off at each of those points, replaces the tunnel while the connect waits for the old release, and checks the release rules of the previous change. Each of ten mutations fails it. It runs with the host tests. Signed-off-by: Erik Bourget <[email protected]>
The four replays this series adds (dock-display-replug, dual-stream-pairing, t8132-v27-connect and t8132-v27-tunnel) are new Aurora contributions to the kernel tree: GPL-2.0-only, not a dual licence. Signed-off-by: Erik Bourget <[email protected]>
…accepts A routed Type-C port's encoder is narrowed to the pipeline driving it, on ordered dual-stream machines too: a route is made before the modeset and does not follow another CRTC there, so the atomic check pairs the connector with that pipeline only (apple_connector_atomic_best_encoder()). Name that mask (dcp_fabric_routed_crtc_mask()) and use it where a route is activated and where a connector adopts a routed port, instead of two copies of the connector-mask call. No change in behaviour. A dock stream's next attachment may be given another pipeline: on the M4 MacBook Air its first stream takes dcpext1 when another port holds dcpext0, and its second then takes dcpext0. Its route publishes the new mask before the hotplug that reports the display, as on every Type-C port. The pairing replay compiles the production atomic check against the fabric core and, for every attachment it makes (both dock streams, busy then free, the dock back on the other pipelines, a hybrid's primary on the hybrid), reads the connector's mask while routed and tries every CRTC with it: each one the mask offers is accepted, and no other. A routed mask that also offers the other Type-C pipeline fails it. Signed-off-by: Erik Bourget <[email protected]>
A present in flight when a Type-C display went is retired by the swap watchdog without a retrain, since the pipeline may drive another display by then. It was marked lost only if the firmware had accepted it when the detach or the CRTC's power-off looked, and any acceptance cleared the mark. A present begun for the display that went and accepted after both had looked was therefore taken as the next display's: on expiry the watchdog invalidated the mode and queued a hotplug against the display plugged in meanwhile. Keep with each present the Type-C attachment it was begun for, counted by the detaches before it (iomfb_present_begun_h17p()), and decide at its retirement whether that display went since. Acceptance no longer decides it. A stuck present of the display attached now is retrained as before. Outputs without Type-C detaches (the internal panel, a fixed HDMI output) keep their first count and are never taken as lost. The replug replay begins presents before accepting them. It adds a present begun before the detach and accepted after the detach and the power-off, and a replacement plugged in before expiry for each order of acceptance against the power-off. Judging the loss at acceptance, never taking a present as lost, or always doing so, fails it. Signed-off-by: Erik Bourget <[email protected]>
…ng's admission appledrm checks that the tunnel it was handed is still requested before each DCP call of its display connect (apple_dp_tunnel_binding_live()). The check releases the DP IN adapter's lock before the call goes out, and the tunnel's deactivation revokes the binding under that lock, so a revocation can fall between the check and the call: DCP is then asked to validate, connect or raise HPD for a tunnel that is going. Add apple_dp_tunnel_binding_call(), which runs a function under the adapter's lock while the binding is live and returns -ESTALE once it is revoked. appledrm queues each call there and waits for DCP's reply after it, since DCP's Activate and Deactivate for the binding take the same lock. Nothing in the provider changes. Signed-off-by: Erik Bourget <[email protected]>
…mission A Thunderbolt DP tunnel's connect checked the provider's admission of its binding before each DPTX call, then released the provider's lock and sent the call. The provider revokes the binding under that lock when the tunnel goes, and the detach that follows waits for this connect, so a revocation between the check and the call still let Validate, Connect, Request Display or HPD high go out for the revoked binding (a host case that revokes right after the check sent Validate). The connect could also report success for a binding revoked while it waited for the link. Queue each DPTX call of the connect under the provider's admission (apple_dp_tunnel_binding_call()): the V2 transport hands the queueing of the call, taking its slot and sending it, to a gate (dcp_dptx_send_gated()) that runs it there while the session's binding is live. A revocation then comes before the call, which is refused (-ESTALE), or after it. The reply is waited for outside, as DCP's Activate for the binding takes the provider's lock. The connect opens the gate around its calls, from the PHY setup to its HPD, and around the HPD it raises after the link wait; its release of a requested display and every other sender are not gated. Before reporting success, the connect checks the admission again: a binding revoked during the link wait leaves the display to its detach. Compact EPIC (desktop 26.x, the M4 backend) can wait for ring space while queueing, so it keeps the check before each call. The connect replay sends every DPTX call through the gate. It adds a revocation right after each of the connect's checks, and one during the link wait with the link come. Sending outside the gate, or not checking again after the wait, fails it. The AFK V2 selftest queues a command through a gate that refuses it and one that admits it. Signed-off-by: Erik Bourget <[email protected]>
…s answer A firmware-27 T8132 dcpext whose gone tunnel's release timed out holds its DPTX port until the firmware answers. Four things were wrong with that hold: - A connect that failed after Request Display released the display ignoring the result and cleared its port, so a release that timed out there neither held the port nor was sent again at the detach: the replacement's DPTX calls went out with the old release outstanding. - The connect cleared the hold outside hpd_mutex and before checking its session, so a connect paused there could clear a hold that a detach had just set. - An empty slot map was taken as the release done, while an answer that refuses the call frees its slot too. - The next connect waited for the answer for 15 seconds and then gave up for good. An answer that came later woke nobody, and a repeated request for the same tunnel was taken as done without a connect, so the display attached meanwhile stayed dark. One never answered left the port unusable without a word. A failed connect now releases its display the way a detach does (dcp_dptx_release_locked()), from the moment Request Display was sent, whatever it answered. A gone tunnel's release that times out holds the port. One not sent or refused is owed: the next release sends it, and a later connect sends it before its own calls. The hold is set and cleared under hpd_mutex only. The transport counts late answers that refuse their call (afk_late_refusals()), and the hold keeps the count from before its call was sent. A connect does not use a held port and does not wait for it: it returns -EBUSY. The answer queues dcp_t8132_port_work(), which frees the port if the release was carried out, sends the release again if it was refused, and then connects the display attached meanwhile from the reconnect work, for the session attached now. A CRTC turned off is not woken. The DPTX service's publication and a repeated request for the attached tunnel queue the same work, so a display whose connect could not run is connected when the cause goes, without the timed retries this series dropped. A release refused again, or never answered, keeps the port held until the display processor's DPTX endpoint is started again (dptxep_init()), and says so. The M4 backend keeps its wait for its compact calls' answers. DPMS now wakes that wait, as it changes what the wait looks for. The connect replay covers a revocation after Request with a release that times out, then a replacement; a release refused at the failed connect, owed to the detach or to the next connect; answers that come late, that refuse the release once or twice, or that never come; a display gone or replaced, or a CRTC turned off, before the answer; the service's publication; and the M4 backend's wait ended by a revocation or DPMS. Each of the old behaviours put back fails it, as do no resume, a resume that wakes a CRTC turned off, a refusal taken as the release, a dropped owed release, and DPMS without a wake. The AFK V2 selftest counts a late refusal and checks that a late answer queues its work. Signed-off-by: Erik Bourget <[email protected]>
…wn answer On firmware 27 a T8132 dcpext's DPTX port is held while the release of a display whose tunnel went is unanswered. The hold ended when no timed-out V2 command of the endpoint was pending and an endpoint-wide count of refused late answers had not moved since the release was sent. That count cannot tell which call an answer was for, and its state outlived the transaction: after a late refusal, a release sent again that failed left the count as the work had last read it, so the next run of the work (the dock repeating its request) took it as the release done and connected the next display with neither release carried out. An HPD low that timed out took the hold too, and its answer could run the work before the detach took the hold, leaving a released port held with nothing to wake it. The firmware's link calls were acted on again as soon as any late slot was free, though the port was still held. Follow the release itself. The V2 transport takes a ticket with a command (afk_service_call_ticket(), afk-ticket.h): sending numbers it, a timeout that keeps the slot makes it LATE, and the late reply of that command, not of any other, makes it DONE or REFUSED. dcp_dptx_release_locked() sends a firmware-27 release with the dcpext's ticket and holds the port on a timeout of a gone tunnel, as before. dcp_t8132_settle_locked(), under hpd_mutex where the hold is taken, ends it on the ticket alone: carried out, the port is free; refused, the display is still requested and its release is owed, which the next connect sends before any connect call (the existing owed-release path), as often as the dock asks, until one goes through. The release that takes the hold settles at once too, for an answer that came between the timeout and the hold. The work no longer sends releases of its own, and the endpoint-wide count and the pending-slot scan are gone. An HPD low that times out goes on to the release as before, whose answer alone decides; it takes no hold of its own. While the port is held, Will/DidChangeLinkConfiguration, Activate and Deactivate are answered as done at the DPTX callback's entry, before the link and 180 Hz state they reset for the next display; the hold, not a free slot, decides there and for the lane and rate reports. The M4 backend keeps its compact orphans and is unchanged. The connect replay models the ticket and adds: a late refusal, the release sent again refused, and two repeated requests (no connect call until a release goes through, then the dock connects); a refusal while the DPTX service is gone (sent first once it is back); another call's late answer and an older release's (the port stays held); an answer before the hold is taken; an HPD low unanswered with the release answered in time (the port is free); the link calls between the answer and the work. Their controls: any run of the work ends the hold, the release does not settle, the filter ends with the slot. The AFK V2 selftests check the ticket through the production sender and reply handler. Signed-off-by: Erik Bourget <[email protected]>
The firmware-27 T8132 port work (dcp_t8132_port_work()) is queued on the system workqueue by the DPTX transport's late answers, by the DPTX service's publication and by the tunnel provider's repeated request. The component unbind cancelled it while those producers could still queue it: an answer between the cancel and the endpoint's shutdown queued it again, and a work run after platform removal freed the DCP would take its hpd_mutex first. Disable it at probe, enable it in dcp_enable_typec_work() at bind and disable it synchronously in dcp_disable_typec_work(), as the other Type-C works: from unbind to the next bind nothing queues it, whatever the producers do, and a disabled work is never run after the DCP is freed. An answer that comes meanwhile is kept in the release's ticket; the bind queues the work once, which takes it (a release answered frees its port). The connect replay compiles the production enable and disable: an answer, a publication and a repeated request after the unbind queue nothing, and the next bind frees the port. Cancelling instead of disabling, or a bind that drops the kept answer, fails it. Signed-off-by: Erik Bourget <[email protected]>
A present on firmware with the IOMFB queue keeps the Type-C attachment it is for (the detaches before it, typec_unplugs), so that its watchdog retires a present of a display that went without retraining the pipeline's next display. The count was read when the firmware answered the SwapStart, after the host had sent it. A present started for the dock's display whose answer came after the detach and a replug took the replacement's count, and once accepted and stuck its watchdog invalidated the mode and queued a hotplug for the replacement. The watchdog also read the count under the queue's lock when it retired the present and retrained afterwards, so a detach in between retrained the replacement. Read the attachment as the host starts the present (do_swap() and the clear swap) and carry it in the SwapStart's cookie to its answer, which begins the present with it (iomfb_present_begun_h17p()). The watchdog takes the present's attachment from its retirement and compares it with the count under hpd_mutex, where a detach counts itself, and retrains under it: a detach after the retirement is seen, and one after the retrain finds it done for the display it takes away. The replug replay starts a present before the detach and answers it after the replug, and puts a detach between the retirement and the retrain (at the queue's lock and while the watchdog waits for hpd_mutex): the replacement is left alone, and its own stuck present is retrained as before. Reading the attachment at the answer, or deciding without hpd_mutex, fails it. Signed-off-by: Erik Bourget <[email protected]>
…sion A Thunderbolt tunnel's connect queues each DPTX call under the provider's admission of its binding (dcp_dptx_send_gated()), so that a revocation comes before the call, which is refused, or after it. Only the V2 transport did. On the M4 backend's compact transport the call went out after the connect's own check, so a revocation between that check and the queueing still sent the call for the revoked binding. A compact message is committed by its first fragment. Write that fragment through the same gate (afk_send_compact()): each try is one write to the ring under the admission, and a wait for ring space is outside it, so the provider's lock is never held while the firmware drains the ring, and the next try checks the admission again. A refused first fragment sends nothing, so no message is left half sent; the rest of an admitted message follows as before. Replies to firmware calls and other senders' commands are not gated, as on V2. Both transports ring the mailbox inside the admission, which can wait for its FIFO; the coprocessor drains that without any host lock. The comments now say so. The connect replay sends the M4 backend's calls through the production afk_send_compact(): revoked right after each of the connect's admission checks, only a release goes out after the revocation; revoked while a call waits for ring space, the next try is refused; a live binding's calls go out, waiting outside the admission. Sending the first fragment ungated, or waiting for space inside the admission, fails it. Signed-off-by: Erik Bourget <[email protected]>
A firmware-27 T8132 dcpext holds its DPTX port while the release of a display whose tunnel went is unanswered, and only that release's own answer ends the hold. An answer that refuses it leaves the release owed, and the replacement tunnel's connect sends it again first. That release held the port only while no tunnel was bound: with the replacement bound, a timeout of the release sent again was returned as on a live link. The port stayed usable, the firmware's link calls were acted on again and the release stayed owed. The dock's next request sent a third release and a connect while the second was still with the firmware, and an answer that carried the second out was followed by a third release the firmware could refuse, leaving the replacement dark. A release owed is of a display no longer wanted, whichever tunnel is bound now. Hold the port for it when it times out, as for a gone tunnel's (dcp_dptx_release_locked()): the hold ends on its own answer, which frees the port, or restores the debt if it refuses the release, and the next connect sends it once more. A failed connect's release is owed from the moment it is sent, so one that times out on a live link holds the port too. The release of a display still connected, on a live or a fixed link, fails as before. The connect replay times the release sent again out with the replacement bound, and has the dock repeat its request before the answer, or the answer come first: only one release is ever outstanding (the mock asserts it at every firmware-27 release), nothing connects until it is answered, and the answer connects the replacement with no release sent again. It also covers a refusal of the release sent again, the replacement going before the answer, a detach's release refused at once and sent again unanswered, and a failed connect's release unanswered on a live link. Holding the release sent again only for a gone tunnel, or owing a failed connect's release only once it failed, fails it. Signed-off-by: Erik Bourget <[email protected]>
…splays #2721, this branch's base, was merged into #2710 and that into #2673's branch, which has since taken main and the T6041 DP IN tunnel work. Resolved: - dcp.c (dcp_dptx_connect_raw()): the base's dcp_assert_hpd_before_link_wait() (fixed HDMI and DP2HDMI) for the HPD assertion before the link wait, with this branch's bookkeeping: a display is connected from its request on, a failure releases it through out_release (which keeps its release owed), and an -ESTALE binding is not logged as an error. The HPD after the link wait takes the base's condition (DP2HDMI with an adopted RTKit) inside this branch's DPTX gate. - dptxep.c: the base's lane check, which skips a DP tunnel on every SoC (this branch skipped it for a T8132 dcpext's tunnel). - dcp-fabric.c/.h: both crossbar tests, dcp_xbar_t8132() and the base's dcp_xbar_t6041(), and both sides' declarations. - apple-dcp selftests: the union of both sides' stand-ins. Signed-off-by: Erik Bourget <[email protected]>
… tests The merge of #2673's branch brought dcp_assert_hpd_before_link_wait() into dcp_dptx_connect_raw(), dcp_xbar_t6041() into the tunnel Activate and its own lane check into dptxport_call_set_active_lane_count(): - t8132-v27-connect-tests.py extracts dcp_assert_hpd_before_link_wait() with the fields it reads; a Type-C output never reads a fixed HDMI HPD, and the GPIO stand-in asserts that. - t8132-v27-tunnel-tests.py: a T8132 route is never a T6041 crossbar. - dptx-set-active-lane-count-tests.py: no T8132 release is outstanding in its cases (dcp_t8132_link_report_late()). - apple-dcp rate.py: the lane check no longer asks dcp_t8132_ext_hw(), so publication-hpd drops its now unused stand-in. Signed-off-by: Erik Bourget <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
An owed release sent again from dcp_dptx_connect_raw() can time out and settle with a late refusal before dcp_dptx_release_locked() returns. dcp_t8132_settle_locked() then clears the port hold and sets release_owed again, so checking only dcp_t8132_port_held_locked() left the connect to validate, request and raise HPD with the earlier release still owed. Stop the connect with -EBUSY when release_owed remains set after dcp_dptx_release_locked(), and add this timing case and its negative control to the connect replay. Signed-off-by: Erik Bourget <[email protected]>
|
Updated the PR body with the J713 (M4 Air, T8132, 27.2 firmware) hardware run at
|
There was a problem hiding this comment.
Verdict: HOLD at 7f21093a
Blockers:
- Targets non-
mainbase branchj713-dcpext/air-dcpext-272(#2673), which is still open and currently conflicts withmain. Full build/KUnit/host-tests CI has not run againstmain. Once #2673 is reconciled and landed onmain, retarget this PR tomainand run full CI + exact-head hardware rows for full review.
Checked: PR base branch (j713-dcpext/air-dcpext-272), dependency PR #2673 status, CI status (readiness and pr-text only), no AI attribution, human Signed-off-by.
Evidence
- Base branch
j713-dcpext/air-dcpext-272corresponds to open PR #2673 (which requires reconciliation againstmainDCP S2R changes before merging). - Because this PR does not target
main,apple-build,host-tests, and KUnit workflows have not run on7f21093a.
|
Acknowledged the Checked compatibility and local verification at
Per branch policy, we will retarget |
|
#3655 touches the same present-retirement code as this PR's "retire only the present of a display that went" and "tie a lost present to the display it was begun for". Whichever of the two lands second should fold them into one mechanism.
|
… fix/t8132-fw27-dock-displays Conflicts: drivers/gpu/drm/apple/afk.c The base serializes TX ring writes and doorbells under the endpoint's tx_lock mutex, taken in afk_send_epic_token(), so a send can no longer run under the service spinlock. Split the ring write from the doorbell (afk_epic_publish_locked() and afk_epic_ring(), with tx_lock held by the caller) and keep afk_send_epic_token() as before on top of them. The gated command send takes tx_lock before dcp_dptx_send_gated(), as the compact path does, and afk_command_enqueue() holds the service lock from the live-service check through the ring publication, dropping it only before the doorbell, so a CLOSE cannot retire the service between the check and the publication. Host harnesses updated for the base: t8132-v27-connect-tests.py names the endpoint's TX mutex tx_lock, and dock-display-replug-tests.py stubs dcp_has_panel() and follows the swap watchdog's new arm condition in its identity-at-acceptance mutation. The AFKV2 sender harness mocks the ring write and the doorbell separately and checks the locks held at each; the ring-admission extractor finds the block in afk_epic_publish_locked(). Signed-off-by: Erik Bourget <[email protected]>
There was a problem hiding this comment.
Superseded 12-01: not a hold under the merge bar (no shown failure). Only merge state checked; follow-ups: retarget after #2673, reconcile with #3655, full CI, J713 two-display TS5 row
Verdict: HOLD at 9cd5ca8a
Blockers:
- Non-
mainbase branch (j713-dcpext/air-dcpext-272/#2673): This PR still targets feature branchj713-dcpext/air-dcpext-272(#2673), so full build/KUnit/host-tests CI has not run againstmain. Once#2673lands onmain, please retarget this PR tomain, reconcile the present-retirement path with#3655if#3655lands first, and run full hosted CI. - Exact-head two-display dock hardware row (
9cd5ca8a): Current PR body rows at7f21093acover internal-panel (eDP-1) smoke/sleep only (no dock or external monitor attached). Please post an exact-head two-displayCalDigit TS5dock bring-up + unplug/replug recovery pass on J713 (T8132, fw27.2) once rebased/retargeted ontomain.
Checked:
- Verified
9cd5ca8ais a clean merge oforigin/j713-dcpext/air-dcpext-272(MERGEABLE), withpr-textandpr-readinesspassing on the feature-branch base.
Evidence
- Head commit:
9cd5ca8a28b4bbd004245807c810062092fbb73d(Merge remote-tracking branch 'origin/j713-dcpext/air-dcpext-272'). - Base branch:
j713-dcpext/air-dcpext-272(#2673).
|
Verified
|
What: Fix two-monitor Thunderbolt dock (
CalDigit TS5) display bring-up and unplug/replug recovery on 27.2-firmware M4 (T8132)dcpextpipelines by driving T8132 display hardware identically across both firmware backends, deferring tunnel connect and gating DPTX calls under tunnel-binding admission, offering the second dock stream all reachable Type-C-only pipelines, retiring lost presents without a retrain, and holding a firmware-27dcpextport until its timed-out or owed release is answered. Stacked on#2673(which now carries#2721).Tested: Verified at current head
9cd5ca8a28b4(Merge remote-tracking branch 'origin/j713-dcpext/air-dcpext-272' into fix/t8132-fw27-dock-displays):linux-j713andlinux-j716carm64 kernel/DTB/modules builds pass cleanly (7.3.0+), targetedW=1compile is clean indrivers/gpu/drm/apple/, 4-config arm64 QEMU KUnit passes (607 passed, 3 skipped, 0 failed), all 44 targeted host test runs acrosst8132,dock-display,dual-stream,tunnel-route,dcpext26,dptx,tiled-split, andapple-afkv2pass (apple-dcp97/99passed with 2 unrelatedaccounting.pyUSB-C mux failures), and all 5 display replays with negative controls pass (see Evidence). Exact-head9cd5ca8a28b4J713 (M4 Air,T8132,27.2, battery, default command line, GRUB one-shot + one-shot Stage 2 witht8132-j713.dtb, standalone build, no dock or external display attached): external display processors probe (DP-1toDP-4present,disconnected),eDP-1connected and enabled,0failed units,0AppArmor denials,0Oops/WARN,errlines = baseline3(no-ENODEVlines); DPMS off/on x3 before and x2 after sleeps,s2idlex2 (rtcwake -m freeze -s 15), and 1x deep suspend/resume (rtcwake -d /dev/rtc1 -m mem -s 20,suspend_statssuccess3,fail0, no reset; one post-deep-sleeperrlineapple-sleep ... 302600000.gpu stop reported 1; physical sleep completed, also logged by the default kernel). Earlier-head (7f21093a0d31, pre-525da017cf2b-merge) J713 internal-panel candidate37edba02c535and 2026-11-28 modified-batch run76649338a1bcare in Evidence. J716c (16-inch M5 Max,T6050, firmware 27.2, AC, default command line, default Stage 2) at9cd5ca8a28b4merged withmain's #3662 (37a19f92f82b, J716c die 0 second MMIO window;9cd5ca8a28b4alone does not boot on J716c without it: the one-shot trial never reached userspace and the dead-man watchdog reset it back to the default kernel), Linux7.3.0, no dock or external display attached, internal panel only: boots to the desktop, 4xeDP-1DPMS off/on and apm_test=devicessuspend/resume cycle each returned to3456x2234@120(connectorconnected/enabled),vkcube --c 240 --wsi waylandclean on BorealisApple M5 Max (G17C B1), Apple MTP keyboard / trackpad and lid devices enumerated,wlan00% loss over 3 pings, 1 failed unit (aurora-peripherals.service, also failed on the default boot), 0 LSM denials, 0GPU fault/MMU fault/ DeviceLost / Oops / WARN lines, kernelerr+the same set as the default boot's base plus theavdfirmware-file probe line. Earlier pre-review testing on a J713 M4 Air (27.2) drove both monitors on a CalDigit TS5 across unplug and replug.Risk: two-way door · M4 (
T8132: J713/J715 Air, J604 14" Pro, J773g mini) on27.2and26.6.2firmware; shared IOMFB lost-present retirement, gated Thunderbolt DP tunnel connects, failed-connect release handling, and V2 command tickets across Apple Silicon Macs.Revert:
git revert -m 1 <merge_commit>on the target branch (or revert the PR's commits in reverse order); no persistent on-disk, firmware, or boot-object state.Not yet: Exact-head
9cd5ca8a28b4two-monitorCalDigit TS5dock hotplug/unplug/replug row on J713 (T8132,27.2; no dock or external display attached in the internal-panel row above); exact-head9cd5ca8a28b4J716c (M5 Max) shared-code external-display unplug/replug regression (the J716c row above had no external display attached); retargeting tomainbefore#2673merges (open at9c353d74c51c) and full hostedmainCI; Macs not in the local lab (H17P M4 Pro/Max, M2 Pro/Max laptop dock, J604/J715/J773g on27.2, and M4 on26.6.2).Details
Problem solved. On
27.2firmware the M4 MacBook Air's twodcpexts are pipelines of the DRM device, and a two-monitor Thunderbolt dock (CalDigit TS5) failed on three paths:dcpext's IOMFB queue until it was declared crashed, and the otherdcpextkept a dead route (-110or-EOPNOTSUPP) until a reboot.Design summary. This PR drives a
T8132dcpext's display hardware the same way on either firmware backend. The tunnel connects from the reconnect work, and each of its DPTX calls is queued under the tunnel provider's admission of its binding, on the V2 and the compact transport, so none goes out after the tunnel is revoked. It never wakes a CRTC that is turned off. A dock's second stream is offered every Type-C-only pipeline it can reach; a routed connector is offered the pipeline driving it, which is what the atomic check accepts. A present started for a display that went is retired without a retrain. When a gone tunnel's release goes unanswered, the route is given back but the DPTX port is held until the firmware answers that release; the answer frees it and connects the display attached meanwhile, and a refusal leaves the release to be sent before the next connect. A release sent again that goes unanswered holds the port the same way, also with a replacement tunnel bound, so only one release is ever outstanding and nothing connects until it is answered and the release is no longer owed.This PR also adds one exported function to
drivers/thunderbolt/apple.c(commit 17), which the DRM side needs: without it every gated connect is refused. Nothing in the provider's behaviour changes. It can move to the Thunderbolt PR, or a small Thunderbolt prerequisite merged first, if the maintainers prefer one PR per subsystem.Known limitations (not changed here).
dcpext's port held until its DPTX endpoint starts again (the display processor's rebind), with no recovery that proves the old session ended.possible_crtcspast the hotplug of its next attachment, when that attachment had to take the other pipeline, is refused until it reads them again (a routed tunnel cannot move to another pipeline at a modeset).T8132crossbar's link-up and its DP IN set active again, which firmware27.2now reaches, is not proven as a strict lower bound (the crossbar reports no link state to wait for; a successful row shows the sequence works at that interval, not that it is the minimum).Commits. Commits 9–25 change functions that earlier commits also change, so they are separate commits on top rather than fixups.
drm/apple: tell T8132 dcpext display hardware from the M4 backend. A newdcp_t8132_ext_hw()is true for anyapple,t8132-dcpext, whichever backend drives it. It now decides the hardware questions:dcp_is_t8132_ext()(the M4 26.6.2 backend) keeps probe, teardown, sleep, DRM hotplug, late teardown answers, readiness and connector-less ports.drm/apple: connect a firmware-27 T8132 dcpext's DP tunnel from the work. The tunnel connects from the Type-C reconnect work, so the provider's call returns at once and it can hand over the dock's replacement request before DCP's Activate. A pipeline of the DRM device starts its Type-C attachment first (dcp_typec_attach_deferred()).drm/apple: a T8132 tunnel output never selected is idle at its release. The T8132 crossbar (runtime PM, T602X map) answers-EOPNOTSUPPto a preselect. For an output that was never selected, that answer now counts as idle, so the route no longer stays owned for good.drm/apple: give a dock's second stream a pipeline the first does not take. This fixed the secondary connector to one pipeline. Commit 10 replaces that rule.drm/apple: say why a Thunderbolt DP tunnel finds no pipeline: a debug-level reason when pairing or the tunnel candidate refuses a stream.drm/apple: keep the swap watchdog of a present in flight at a disconnect or power-off. Kept the watchdog of an accepted present at the Type-C disconnect and at every power-off of a queue-backed CRTC, and armed it on unrouted pipelines without a fixed connector. Commit 11 narrows both.drm/apple: release a firmware-27 T8132 dcpext display whatever the firmware answers. Took any release error as done on firmware 27 too, with the reconnect work's timed retries. Commits 12, 13, 19 and 20 replace this.tools/asahi: replay a dock's displays going and coming back on firmware 27. Commits 11 and 16 rewrite the replay.drm/apple: take the T8132 dcpext lane-count exception from the hardware. A tunnel has no DP PHY lanes to check, so firmware 27.2 no longer logs "unexpected lane count" on valid increases. Also corrects two comments, including what the 5–6 ms crossbar settle is.drm/apple: offer a dock's second stream every Type-C-only pipeline it can reach.dcp_typec_port_carries_stream()).dcp_fabric_second_yields()), both in the tunnel candidate and in the pairing pass, which falls back when nothing above that candidate is left.-EBUSY. With a hybrid in front (M2 Pro/Max) the mask is the one Type-C-only pipeline as before.drm/apple: retire only the present of a display that went.dcp_swap_watched()). The J713/J715 and J604 dcpexts declare a USB-C connector, so they are Type-C outputs without a route and were already watched.iomfb_present_lost()keeps the watchdog of a present in flight under the IOMFB queue's lock, where the firmware's acceptance and completion also run.drm/apple: hold a firmware-27 T8132 dcpext port until its release is answered. Only a release that timed out for a display whose tunnel is gone is taken as done, and only to give the route back.-ENOSPC, refusals, and live or fixed links return their error as on every other path. The firmware's Activate, Deactivate, link, lane-count and hotplug-detect calls are not acted on until the answer. Commits 19 and 20 change how the hold ends; commit 24 also holds for an owed release.drm/apple: admit every deferred tunnel DPTX call and leave a CRTC turned off. DPMS setstypec_crtc_offunderhpd_mutex, where the connect checks it before each call; the detach completes a tunnel's link wait; a T8132 dcpext connects once per tunnel on either firmware (the five blind retries a second apart are gone). Commit 18 replaces its admission check before each call.tools/asahi: license the dock display replays GPL-2.0-only.drm/apple: offer a routed Type-C connector the CRTC its atomic check accepts. No change in behaviour: a routed port's connector is offered the pipeline driving it, on ordered dual-stream machines too, as on the base, now through one helper (dcp_fabric_routed_crtc_mask()). A route does not follow another CRTC at a modeset, so that is whatapple_connector_atomic_best_encoder()accepts; a stream's next attachment publishes its new mask before the hotplug that reports it. The pairing replay checks this against the production atomic check at every attachment.drm/apple: tie a lost present to the display it was begun for. Each present keeps the Type-C attachment it is for (the detach count,iomfb_present_begun_h17p()); its retirement compares that with the count then. A stuck present of the display attached now is retrained as before. Commit 22 moves where the attachment is read.thunderbolt: apple: let appledrm queue a DCP call under a DP IN binding's admission.apple_dp_tunnel_binding_call()runs a function under the DP IN adapter's lock while the binding is live, else returns-ESTALE. The binding's revocation takes the same lock.drm/apple: queue a tunnel connect's DPTX calls under its binding's admission.dcp_dptx_send_gated(). For a Thunderbolt tunnel's connect, that runs it insideapple_dp_tunnel_binding_call(), so a revocation comes before the call, which is refused, or after it. The reply is waited for outside, as DCP's Activate for the binding takes the provider's lock.drm/apple: free a held firmware-27 T8132 dcpext port on the firmware's answer.dcp_dptx_release_locked()): a gone tunnel's release that times out holds the port; one not sent or refused is owed to the next release, and a later connect sends it first.hpd_mutexonly. A connect does not use a held port and does not wait for it.dcp_t8132_port_work()runs on each late answer, the DPTX service's publication and a repeated request for the attached tunnel, and connects the display attached meanwhile from the reconnect work, for the session attached now. A CRTC turned off is not woken. Commit 20 replaces how it decides the release was answered.drm/apple: free a held firmware-27 T8132 port only on its release's own answer.afk_service_call_ticket(),afk-ticket.h): sending numbers it, a timeout that keeps the slot makes it LATE, and the late reply of that command, not of any other, makes it DONE or REFUSED.dcp_t8132_settle_locked(), underhpd_mutex, ends the hold on that ticket alone: carried out, the port is free; refused, the release is owed and the next connect sends it before any connect call, as often as the dock asks, until one goes through. Another call's answer, an older release's, a run of the work or a free slot never ends it. The release that takes the hold settles at once too, for an answer that came before it.drm/apple: keep the T8132 port work off from unbind to the next bind. The work is disabled at probe, enabled at bind and disabled synchronously at unbind, as the other Type-C works: nothing queues it after unbind, and it never runs after the DCP is freed. The bind queues it once, which takes an answer that came meanwhile from the ticket.drm/apple: carry a present's attachment from its SwapStart. The attachment is read when the host starts the present and carried in the SwapStart's cookie to its answer, so a present started before a detach and answered after a replug is still the display's that went. The watchdog decides and retrains underhpd_mutex, where a detach counts itself.drm/apple: queue a compact DPTX call under its tunnel binding's admission. The M4 backend's compact transport commits a message with its first fragment: that fragment is written through the same gate, one ring write per try, and the wait for ring space is outside the admission. A refused first fragment sends nothing, so no message is left half sent.drm/apple: hold a firmware-27 T8132 port for an owed release sent again.dcp_dptx_release_locked()), also once the replacement tunnel is bound and its connect sent it. Before, it held only while no tunnel was bound: with the replacement bound the timeout was returned, the port stayed usable and the release stayed owed, so the dock's next request sent another release and a connect while the first was still with the firmware.drm/apple: stop a connect when a late refusal leaves its release owed: stopsdcp_dptx_connect_raw()with-EBUSYifrelease_owedremains set afterdcp_dptx_release_locked(), when a timed-out owed release settles with a late refusal before returning (clearing the port hold while leaving the release owed).9cd5ca8a28b4(Merge remote-tracking branch 'origin/j713-dcpext/air-dcpext-272' into fix/t8132-fw27-dock-displays): resolves theafk.cmerge conflict with the base'stx_lockserialization by splittingafk_epic_publish_locked()andafk_epic_ring()underep->tx_lock, takingep->tx_lockbeforedcp_dptx_send_gated()inafk_send_command_common(), and holdingservice->lockinafk_command_enqueue()through ring publication only, plus updatingt8132-v27-connect-tests.py,dock-display-replug-tests.py, andapple-afkv2harnesses to match.Each commit builds and passes the replays and selftests it contains.
What does not change
dcp_is_t8132_ext()anddcp_t8132_ext_hw(). Its release and HPD-low handling, and its compact orphans, are as before; its teardown wait is woken by events instead of polling in 50 ms slices, with the same bound. The main device has no connector for the dcpext ports, so the connector masks do not reach them. Its tunnel connect's compact calls are now queued under the provider's admission (commit 23).Behaviour changes beyond the M4 Air on 27.2
-EOPNOTSUPP.hpd_mutex.Related. The Thunderbolt half of the same dock replug is a separate PR,
#3269(onmain). It holds the shared-rate DP re-link while the display reads its DPRX. Neither PR needs the other to build or to pass its tests. Both are needed for a two-monitor dock to light reliably across a replug. The hardware row should name whether it ran this PR alone or together with that PR.Evidence
7a8022a6d24d(#2673head at time of initial merge), updated to merge#2673(525da017cf2b) at current head9cd5ca8a28b4. Compatibility check:git merge-tree --write-treeagainst#2673's current head (j713-dcpext/air-dcpext-272at9c353d74c51c) exits0(dbaa9c605e6b), verifying clean compatibility with#2673.9cd5ca8a28b4:linux-j713andlinux-j716cprofiles,LLVM=1): exit0(Image.gz,dtbs,modules.tar.zst,7.3.0+).W=1arm64 compile (aurora_defconfig,LLVM=1,drivers/gpu/drm/apple/{afk,apple_drv,dcp-fabric-core,dcp-fabric,dcp,dptxep,iomfb}.o,drivers/thunderbolt/apple.o):0errors,0warnings indrivers/gpu/drm/apple/*andapple_dp_tunnel_binding_call()(only pre-existing kernel-doc warnings onapple_cioandapple_nhiindrivers/thunderbolt/apple.c).607 passed, 3 skipped, 0 failedacross all 4 suites):drivers/gpu/drm/apple/tests/display.kunitconfig:169 passed, 1 skipped(apple_g17_rx_util_min_test, needsCONFIG_UCLAMP_TASK),0 failed;drivers/gpu/drm/apple/tests/.kunitconfig:117 passed, 0 failed;drivers/gpu/drm/apple/tests/topology.kunitconfig:209 passed, 1 skipped, 0 failed;drivers/thunderbolt/.kunitconfig.apple-dpin:112 passed, 1 skipped, 0 failed(thunderbolt+apple-dpin-lifecycle).python3 -I tools/asahi/run-host-tests.py --only ...):t8132(6/6),dock-display(1/1),dual-stream(1/1),tunnel-route(1/1),dcpext26(23/23),dptx(8/8),tiled-split(2/2), andapple-afkv2(2/2, gcc + clang) —44/44 passed.apple-dcp(HOSTCC="clang -Wno-unused-but-set-global"):97/99 passed(the 2 failures,same-handle-srcu-indexandmux-release-stagesinaccounting.py, exercisedrivers/usb/typec/mux.c/cd321xuntouched by#3273).t8132-v27-connect-tests.py:30negative controls passed,38scenarios passed;dock-display-replug-tests.py:10negative controls passed,9scenarios passed;dual-stream-pairing-tests.py:9negative controls passed,29scenarios passed;t8132-v27-tunnel-tests.py:3negative controls passed,5targets passed;tunnel-route-tests.py:4negative controls passed.git diff --check 525da017cf2b..9cd5ca8a28b4: clean.M4 Air,T8132,27.2) at9cd5ca8a28b4(standalone build; Linux7.3.0, battery 50% to 43%, default command line, GRUB one-shot + one-shot Stage 2 carryingt8132-j713.dtb, no dock or external display attached):DP-1toDP-4present,disconnected);eDP-1connected and enabled;0failed units,0AppArmor denials,0Oops/WARN;errlines = baseline3(no-ENODEVlines).s2idlex2 (rtcwake -m freeze -s 15); 1x deep suspend/resume (rtcwake -d /dev/rtc1 -m mem -s 20,suspend_statssuccess3,fail0, no reset); after the deep sleep one extraerrline,apple-sleep ... 302600000.gpu stop reported 1; physical sleep completed, which the default kernel logs after its own deep sleep too.7f21093a0d31— J713 (M4 Air,T8132,27.2) in candidate37edba02c535(j713-dcpext/air-dcpext-272fd3dc16c121b+#32737f21093a0d31+#32972b1bab104938+#33004b09f0691c2d, without#3269, default command line +panic=10, no dock or external monitor attached):0failed units,0AppArmor denials, 3 kernelerrlines (all matching the default kernel:dcpAFK init-props-2, DFB layoutcompression=3, andapple_sepmatching notice).dpmsStatusfalse/true, crtc 0/1) before sleep and 3 more after deep-sleep resume.s2idle(20 s): cleanPM: suspend exit, 1 newane_syspower-state line (requested 0x200f, now 0x2b4f).deepsleep: clean entry and exit (no reset); post-resume loggeddma-controller isn't boundand302600000.gpu stop reported 1; physical sleep completed; allisp,venc, andavd_sysdomainsoff-0,dispext*anddisp_*on.T8132,27.2) on76649338a1bc(J713 default kernel source8dbfa2895b93plus 10 PR heads, with7f21093a0d31in ancestry; default command line pluspanic=10):7f21093a0d31, and newermain/daily hunks replaced eight lines of this PR's s2r code indrivers/gpu/drm/apple/dcp.c(matching the directmainconflict). No CalDigit TS5 and no external monitor were attached (DP-1..DP-4disconnected,boltctlTS5disconnected), so no dock hotplug, unplug, or replug path was exercised.dcpexts probed (apple-t8132-display: 27.2: Type-C routes and display DARTs enabled for 2 dcpext(s), external display DARTslocked roots kept),eDP-12560x1664@60up,0failed units. Booted kernel image SHA-256e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491, one-shot Stage 2 SHA-256f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa(default Stage 2 and kernel untouched).W=1compile at7f21093a0d31(703/704host suites,602passed /3skipped KUnit,checkpatch.pl --strict0/0/0ona2a3cccbb356..7f21093a0d31) anda2a3cccbb356/26660afa93eaalso passed prior to the9cd5ca8a28b4base merge.