Skip to content

Rebase onto Asahi 7.2.11 - #158

Merged
2691 commits merged into
omacom:integration/aurorafrom
aurora-silicon:unified/7.2.11
Oct 23, 2026
Merged

2691 commits merged into
omacom:integration/aurorafrom
aurora-silicon:unified/7.2.11

Conversation

@RyanTheTide

Copy link
Copy Markdown
Collaborator

Moves integration/aurora from Asahi 7.2.10 to Asahi's current base, asahi-wip v7.2.11 (e09c62843a8e). It's a merge commit: the first parent is integration/aurora 44d5afc79da7 (the #139 merge), the second is the re-assembled tree d12930d02e97.

What changes: essentially Asahi's own 7.2.10→7.2.11 delta (296 files, +3677/−1630, against Asahi's +3668/−1627), plus about 10 lines of ours. Every Aurora lane is rebased onto e09c62843a8e with authors, dates and messages unchanged.

Where the rebase needed real work:

  • Input: dockchannel takes 7.2.11's ordered workqueue. Our own fix for the same 7.2 warning is dropped in favour of Asahi's.
  • User pages (user4k): 7.2.11 added a keep_source argument to copy_vma() (the MREMAP_DONTUNMAP fix), and our version adds a page-offset struct. It now takes both, in mm and in the userland VMA test. The user4k KUnit build fix is folded into its source commit, so every commit still builds.
  • Display:
    • apple_plane_init() takes both our supports_xrgb2101010 and Asahi's new interchange argument.
    • The 14.7 plane uses the linear-only modifier list.
    • New: Asahi's Interchange framebuffer formats aren't advertised on H17P firmware (T8140/T8122) until they're qualified there. Asahi's series has no per-SoC limit.
  • Config: 7.2.11's asahi.config now sets RESET_APPLE_CIO=m itself, so our generator only makes it built-in for the J700.

Gates on bd526b3c11cc:

Not yet: hardware. The Neo qualification of this build runs next and I'll post the result here; the ref Macs follow. Please merge with a merge commit or a fast-forward.

🤖 Generated with Claude Code

chriskearney and others added 30 commits October 18, 2026 06:03
When every display pipeline is taken, apple_dcp_tb_dp_tunnel() refuses a
new Thunderbolt display with -EBUSY, and the DP IN worker logged "DP tunnel
setup failed" and gave up. Nothing asked again when a pipeline came free,
so the dock's display stayed dark until the dock was replugged.

Treat -EBUSY as waiting: log it once, then re-queue the worker every two
seconds while the tunnel stays up, and log when the display lights. The
retry stops when the tunnel goes down, and is cancelled before the work
queue is destroyed. A failed attempt keeps only the mapped adapter
registers, which the next attempt reuses and teardown unmaps.

[ryan: adapted to 7.2.10 — retain current DP-IN handshake and host teardown while adding delayed display-capacity retry]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 9c2abc1)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On M1 Pro/Max laptops with two external displays already lit, a dock's
display tunnel is refused a pipeline and waits for one (08c8f10). The
DPRX capability read cannot complete before the host drives the tunnel, so
12 s later the connection manager tore the tunnel down as failed ("not
active, tearing down") and the dock's display stayed dark after a pipeline
freed, until the dock was replugged.

Add a dp_tunnel_awaits_display host hook. While it reports the tunnel as
waiting, the DPRX worker keeps the tunnel, looks again once a second
without the 25 ms busy wait, and restarts the DPRX timeout, so the usual
12 s apply from when the host takes the tunnel. Only the Apple glue for
M1-family hosts implements it; everything else is unchanged.

[ryan: adapted to 7.2.10 — adapt display-wait hook to current M1/M2/M3 host callbacks and retain 7.2 DPRX reference ownership]


(cherry picked from commit ed948a1)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… in sleep

Review follow-ups to 08c8f10 and the DPRX hook before it:

- Only M1, M1 Pro and M1 Max hosts let a refused tunnel wait: there the
  connection manager now keeps it (dp_tunnel_awaits_display). M2 Pro/Max
  go back to warning once, as before, until the retry is qualified there.
- Stop asking appledrm from NHI prepare to complete: no new attempt while
  devices suspend or resume, an attempt in flight finishes first, and a
  tunnel still waiting asks again once everything has resumed.
- While the host reports a tunnel as waiting, the DPRX worker no longer
  reads the adapter at all; it only re-checks once a second.
- appledrm now answers -EADDRINUSE when another tunnel stream already holds
  the port, so only a lack of pipelines (or a DP-alt route still being
  torn down) is waited out, and the "port already routed" warning cannot
  repeat every retry.

[ryan: adapted to 7.2.10 — preserve 7.2 lock and DPRX cancellation contract; split DCP allocator error change to 200 and pause only qualified capacity retries]

Fixes: 08c8f10 ("thunderbolt: apple: retry a DP tunnel left without a display pipeline")
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit e0b7263)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…t waits

Review of b06160a:

- A retry that fails for any reason but a busy pipeline left the adapter
  marked waiting, and the connection manager then kept the tunnel past
  its DPRX timeout with nothing retrying it any more. Clear the wait and
  its timer on such errors, so the tunnel is handled as before.
- The pause around system sleep now applies only to hosts that retry
  (M1 family). M2 Pro/Max are back to their old prepare and complete,
  without a flush that could sit in the wait for appledrm to load.
- That wait gives way when system sleep starts, and the attempt is retried
  after resume, instead of holding up suspend for up to 30 s.

Tunnel events themselves still bring a display up or down whenever they
come, as before this series.

[ryan: adapted to 7.2.10 — retain current host PM and teardown paths while clearing terminal display waits]

Fixes: b06160a ("thunderbolt: apple: wait for a display pipeline only on M1 hosts, not in sleep")
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 6beefdb)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Select the qualified DP-IN policy from controller match data and the
root SoC. Record host DP behavior in explicit NHI flags instead of
callback-presence tests. Preserve the existing M2 laptop board gate
until the DT route binding lands, and leave Ultra, base M2 and desktops
disabled.

Add the pure lifecycle decision core and its independent old-rules trace
oracle before replacing the existing worker. Check every legacy boolean
transition, readiness retry budget, whole policy profile and module-
parameter hook gate. Keep the ordered workqueue non-freezable and
document the removal drain lock invariant.

[ryan: adapted to 7.2.10 — retain current M2/Type 7 host sequencing and 7.2 DPRX ownership while introducing explicit DP-IN policy and lifecycle KUnit core]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 322afd3)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Replace the adapter's five lifecycle booleans with the tested state core.
Keep MMIO, DCP calls, mappings, retry scheduling and logging in the
executor, outside the state-planning lock where required.

Preserve the existing changed and pre/post notification positions,
ordered non-freezable queue, blocking readiness loop and retry budgets.
Retain paused first activation, coalesced changed-path replacement and
the other deferred fixes as baseline behavior.

[ryan: adapted to 7.2.10 — drive current DP-IN handoffs through extracted lifecycle decisions without changing host PM and reference contracts]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 89c170f)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Close admission for new M1-family display handoffs before draining DP-
IN work during prepare. Keep their pending state and replay once at
complete, including when another device aborts suspend. Preserve
established handed callbacks, synchronous teardown and the existing
capacity retry timing.

Check pause, map the adapter and enable its interrupts under the same
lock. That admission owns the first display call; prepare drains
admitted work. Keep pending-first DPRX retention from a paused UP
until actual admission, without retaining terminal failures merely
because the controller paused. End a removed NHI's PM gate after its
producers stop and work drains so a replacement NHI does not inherit a
prepare that will never complete.

Enable this policy only for the qualified T8103/T6000/T6001 profile.
Keep M2/M3 behavior and the ordered workqueue flags unchanged. Cover
deferred first activation, aborted suspend, admission races, DPRX
retention, terminal failure and prepared-device replacement in KUnit,
retaining the old-rule trace oracle for the unaffected behavior.

[ryan: adapted to 7.2.10 — defer M1 handoffs across sleep; adapt worker tests to 7.2 callback signatures, domain references and completion/drain ordering]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit e9f66be)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Issue nonzero cookies per handoff and separate requested, admitted and
returned display ownership. Validate immutable bindings before DP-IN MMIO,
including synchronous Activate before attach returns. Reject superseded
completion and force replacement when tunnel events coalesce.

Change the shared interface, TB caller and DCP provider together. Revoke
callbacks before draining reconnect outside the fabric and DCP locks on
both detach and failed attach. Idle the powered adapter synchronously on
replacement before the old binding drains and its registers are unmapped.
Publish cookie acceptance and lifecycle state in the same locked operation,
so a running worker cannot activate before a delayed replacement event.
Preserve SoC qualification, readiness waits and retry policy.

Exercise cookie admission, supersession, same-cookie idempotence, counter
saturation and powered request ordering with KUnit and fake effects.

[ryan: adapted to 7.2.10 — split DCP fabric implementation to 200; add immutable generation requests while retaining 7.2 callbacks, domain references and current cancellation tests]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 3519a4b)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Replace the M2 laptop board list with the shared per-connector DT query.
Keep root SoC qualification and hardware flow descriptors separate, and
require the NHI connector wiring as well as its Type-C index for the
right-hand bandwidth grant.

Qualify the ATC tunnel clock through its own connector. Preserve EINVAL
for invalid PHY cores when qualified M2 routes exist elsewhere, and keep
the existing M1 and M3 clock sequences. Delete the shared board helper.
M2 desktops, T6002 and T8112 remain disabled.

Exercise the production SoC, wiring and right-grant guards with KUnit.
A libfdt-backed host harness compiling the production query and consumer
helpers matches all 787 baseline outcomes across 113 current DTBs and
four old ESP DTBs, including hooks with dp_display off and invalid ATC
core errors. No DT files change.

[ryan: adapted to 7.2.10 — retain J700 tunables and 7.2 callback prototypes; combine ATC test wiring with existing PHY KUnit symbol and preserve qualified M1/M2/M3 clock paths]

[ryan: shared header API from ce7b33b; DCP implementation remains in 200-dcp]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
(cherry picked from commit 8ecde2b04477de6c9a345f8075d4cdc75a9390c3)

(cherry picked from commit 5a07508)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
A fresh symbol lookup can fail while the display module is entering exit,
before shutdown has stopped callbacks. Treating that failure as a completed
detach frees a binding that Deactivate can still use.

Keep the module reference and exact provider callable acquired by attach
with its binding. Detach uses that callable without another lookup, and
drops the reference only after callback revocation and drain return.
Failed attach attempts release their reference after provider drain.
Ordinary module unload stays blocked while a handoff owns its reference.

Exercise the production ownership executor with retained handoffs, denied
fresh lookup at detach, failed attach retry, superseded completion cleanup
and absent providers. Preserve the generation and readiness rules.

[ryan: adapted to 7.2.10 — retain display provider module ownership through immutable binding drain with current 7.2 callbacks]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 715a522)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The PCI xHCI driver routes normal transfer events to interrupter zero
and registers, synchronizes and frees only its IRQ. Reserving additional
MSI-X vectors according to the CPU count consumes shared interrupt
capacity without providing additional event handlers.

Request one vector, keeping MSI-X preference, MSI and legacy fallback,
and failure cleanup unchanged. Keep the hardware interrupter count
available to secondary event-ring users.

[ryan: adapted to 7.2.10 — retain current 7.2 APIs and J700 ownership while layering this ordered source change]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 1613116)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8122 generation of the Type-C PHY (M3 family: t8122, t6030, t6031)
keeps its DisplayPort AUX block in the core register window at 0x16000
and brings each lane pair up as two DisplayPort transmitters: the TX
block and the RX block running in transmit mode.

Add the register-level sequences as static inline helpers on the core
MMIO base, so the driver can call them from its existing DP paths:

  - AUX channel power up/down and a readback check
  - per lane pair TX and RX-as-TX power, start and stop
  - the AUSPLL descriptors for RBR, HBR, HBR2 and HBR3
  - the drive presets for each DisplayPort voltage swing and
    pre-emphasis level, and the DP lane to lane-pair mapping

Nothing calls the helpers yet. The sequences drove two-lane DP alt mode
on all three USB-C ports and four-lane DP to the HDMI converter at up
to HBR3 on a J514S.

[ryan: adapted to 7.2.10 — add licensed T8122 DP helpers alongside current J700 and tunnel helper headers]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit e9e4dcc)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On the T8122 generation (t8122, t6030, t6031) the DisplayPort mode was
only half set up. Mux setup switched the lanes and the crossbar to DP,
but AUX stayed off, and phy_configure() ran the T8103 AUSPLL sequence
with that generation's register offsets. So a DP alt mode sink, or the
HDMI converter, never got an AUX channel or a main link.

For PHYs matched by "apple,t8122-atcphy":

  - power the AUX block up at the end of atcphy_configure(), once the
    PHY reset is released and RCAL is done, for the modes that want
    AUX (DP and USB3+DP);
  - on phy_configure(set_rate), program the AUSPLL for RBR to HBR3
    with the APB handshake the T6030 tunnel clock already uses, wait
    for lock, release the PMA lane reset and start the transmitters of
    the lane pairs the mode gives to DP: both pairs for pin C/E, the
    non-USB pair for pin D, following the cable orientation;
  - a link rate of 0 stops the lanes and powers the PLL down;
  - stop the link and AUX before every mode change.

Refuse a rate while the PHY is not in a DP mode (-ENOLINK) or while
the Thunderbolt tunnel clock owns the AUSPLL (-EBUSY).

T8103-generation PHYs (M1, M2) and T8140 keep their existing paths:
the new code runs only behind the per-SoC dp_t8122 flag, and the only
other edits are comments.

[ryan: adapted to 7.2.10 — wire T8122 DP through 7.2 per-SoC callbacks, waking/calibrating DP modes while preserving J700 AUX/training and M1/M2 paths]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 1687087)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DisplayPort link training settles on a voltage swing and pre-emphasis
level per lane. On the T8122 generation each level pair maps to an
equalizer preset of the lane's TX or RX-as-TX block.

Handle phy_configure() with set_voltages on these PHYs: check every
requested level pair first, then program the preset of each lane.
Lanes fill the lane pairs that carry DP in ascending order, and the RX
block of a pair carries the lower lane. Until a level is set, the
lanes keep the initial equalizer the link-rate sequence programs.

set_voltages needs a running link (-ENOLINK otherwise). T8103 and
T8140 PHYs still reject it.

[ryan: adapted to 7.2.10 — retain current 7.2 APIs and J700 ownership while layering this ordered source change]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 8fd7f83)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8122 generation never read apple,tunable-lane{0,1}-dp, so a
bootloader that passes per-device DP lane values had no effect. The
T6030 nodes on the J516S carry none today; the DP lane sequence
programs the lanes without them.

On PHYs matched by "apple,t8122-atcphy", read the two properties when
present and apply them to the DP lanes like the T8103 generation does.
A missing property is not an error. T8140 keeps skipping them.

[ryan: adapted to 7.2.10 — retain current 7.2 APIs and J700 ownership while layering this ordered source change]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 16a069b)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On T6030 the HDMI port is fed by a fourth ATC (ATC3) that only carries
DisplayPort to the on-board DP-to-HDMI converter. No USB controller is
described behind it. Like atcphy3 on the M1/M2 Pro and Max, the display
driver selects its DP route and forces the PHY into four-lane DP through
the Type-C mux.

Treat a T8122-generation node without "usb2phy" and "pipehandler"
register ranges as a DisplayPort-only instance:

  - map only the windows it has; "core" stays required;
  - skip the USB2 power, the dwc3 reset controller and the PIPE setup,
    and register only the DP PHY next to the Type-C mux and switch;
  - accept only the off state and four-lane DP from the mux;
  - read its common and axi2af tunables, but not the USB lane ones.
    Without its calibration tunables DP stays disabled, with a warning.

The DP AUX, AUSPLL and lane sequences are shared with the USB-C ports,
so HDMI gets RBR up to HBR3 on both lane pairs.

Nodes with all five ranges, including an ATC3 described that way, and
every other generation, probe as before. PHY xlate now returns -ENODEV for a PHY type the instance does
not provide.

[ryan: adapted to 7.2.10 — add DP-only T8122 resources and mode admission to the current mux helpers while retaining J700 dirty-state and fixed-hub PIPE ownership]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 7dea14a)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Every Type-C mode change with a USB device attached tears dwc3 down: it
sets SUSPHY, exits its core and powers the USB3 PHY off, and the PHY
then routes the PIPE back to the dummy backend. That routing first asks
for the PIPE lock. The lock is acknowledged from the PIPE clock, which
the stopped controller no longer runs, so the request times out after
1 ms and logs

  Pipehandler lock not acked.
  Failed to lock pipehandler

The PIPE is switched anyway. The same two lines appear on an M1 Air
whose DP alt mode works, so they are noise. On the M3 Pro they are the
first thing logged when a USB-C display is plugged in.

For PHYs matched by "apple,t8122-atcphy", skip the lock when parking
the PIPE from the USB3 power-off and dwc3 reset paths. The fixed-hub
path, where dwc3 keeps running, and the mode-change path still lock.
Other generations are unchanged.

[ryan: adapted to 7.2.10 — keep the fixed-hub running-host KUnit lock refusal with stopped=false]

[ryan: adapted to 7.2.10 — extend stopped-controller parking to T8122 while retaining #353 fixed-hub ownership, retryable state and error propagation]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit a05fc8b)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Cover the pure parts of the T8122 DisplayPort helpers without PHY
hardware:

  - the link rate table: RBR to HBR3 only, the frequency counter target
    and loop coefficients of each AUSPLL descriptor, the RBR divider,
    and an RBR descriptor equal to the one the T6030 tunnel clock uses;
  - the drive presets: exactly the voltage swing and pre-emphasis pairs
    DisplayPort allows, and decoded values that fit their register
    fields;
  - the DP lane to lane-pair mapping for pin D in both orientations
    and for four-lane DP.

The suite runs under the existing CONFIG_PHY_APPLE_ATC_KUNIT_TEST
option.

[ryan: adapted to 7.2.10 — combine T8122 DP helper tests with existing ATC driver and tunnel KUnit suites without redefining the config symbol]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 932614e)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
A T8122-generation PHY (t8122, t6030, t6031) failed to probe when any
tunable property was missing. The bootloader copies a PHY's tunables
all or nothing: if one entry it expects is absent, the PHY gets no
tunables at all. A failed probe also leaves the PHY's consumers

[ryan: adapted to 7.2.10 — permit T8122 common-only DP calibration without overwriting J700 validated DP bundle state or weakening its SuperSpeed admission]

deferring: the DCP that drives HDMI waits forever for its DP PHY, and
with it the Type-C ports that share its routes.

For PHYs matched by "apple,t8122-atcphy", treat a missing tunable
property as the T8140 does: probe, warn "SuperSpeed tunables missing,
USB2 only" and refuse the SuperSpeed modes. A malformed tunable still
fails the probe.

Four-lane DP on this generation programs its lanes itself and does not
use the USB or USB4 lane tunables. So when only lane tunables are
missing and the common and axi2af tunables are present, the PHY still
accepts DP mode, and the warning says DisplayPort stays available.

With all tunables present, as on ATC0-2 of the J516S today, nothing
changes. Other generations are unchanged.

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 57ce5f4)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…P IN outputs

On T6030 the crossbar already programs its two DP IN outputs itself:
selecting a source writes only the route field, and the clocks and
enables are switched when the link comes up or goes down
(apple_dpxbar_t6030_link()). The DP PHY output still used the generic
t602x path, which enables the clocks at select time, before the PHY
has a link rate, and writes registers the T6030 sequence does not use.

Handle the DP PHY output the same way on T6030. Its field in the gate,
select and enable registers is at bit 8, after DP IN 0 (bit 0) and
DP IN 1 (bit 4). Selecting it now writes only the route field, and
apple_dpxbar_link_up()/_down() bring its clocks up and down.

This only changes T6030 crossbars (t6030_dpin needs the apple,t6030
machine compatible); every other SoC keeps its current path. The DCP
side has to call apple_dpxbar_link_up() once the PHY link is configured,
and _down() before the link changes; until then a T6030 DP PHY route
stays unclocked.

[ryan: adapted to 7.2.10 — scope DP PHY output routing and clock gates to T6030 while preserving M1/M2 and J700 crossbar sequences]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 370fd11)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On T8122 PHYs the PIPE lock handshake that starts the routing to USB3 is
only acknowledged while the dummy PIPE backend (bit 15 of
PIPEHANDLER_NONSELECTED_OVERRIDE) is enabled. These PHYs come out of boot
with the bit set. The driver never touched it on PHYs with a USB4
controller, so it stayed set until the PHY's power domain was switched
off, which clears it.

Seen on a J516S (M3 Pro) after s2idle: before the first USB3 start the
PIPE registers read nonsel=0x1332 instead of 0x9332, the lock request
timed out, and dwc3 fell back to USB2 ("USB3 PHY setup failed, USB2
only, err=-110"). The same sequence before the suspend, with the bit
set, routed the PIPE to USB3.

Add park_dummy_phy, set only for apple,t8122-atcphy, and enable the
dummy backend whenever the PIPE is parked on it, at probe and on every
park, as T8140 does already. On a PHY that kept the bit from boot this
writes the value it already holds. The PIPE is parked again after a
power-down by the following change.

Other PHYs are unchanged: atcphy_needs_dummy_phy() reduces to the old
!has_usb4 test for them.

[ryan: adapted to 7.2.10 — retain #353 live-PIPE and pending-state ownership while enabling the T8122 dummy backend when parked]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit d9930aa)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The registers of a T8122 PHY reset when its power domain is switched
off. In system sleep that happens to every domain whose devices are all
suspended. On the J516S (M3 Pro) that covers a Type-C port whose USB
controller has no role, and the DisplayPort-only PHY of the HDMI port,
the only device in its domain. The driver kept tracking the old state:

- The PIPE was still recorded as parked, but with the dummy backend
  disabled. The next USB3 start timed out in the lock handshake, and
  dwc3 ran the port USB2-only. Seen after s2idle on typec2: "USB3 PHY
  setup failed, USB2 only, err=-110".
- The HDMI PHY kept mode DP, with the AUX channel recorded as on. The
  display controller selects that mode once, at probe, so nothing set
  the PHY up again, and link training failed after resume ("link fault
  on target 0:3").

Follow the domain with a genpd notifier. Once it was off, the first PHY
operation or the resume callback, whichever comes first, brings the PHY
back:
- first the baseline probe sets up: controller reset asserted, USB2 and
  the PHY off, the PIPE parked with the dummy backend enabled;
- then the mode the Type-C mux selected, which applies the tunables
  again, sets up the lanes and powers the AUX channel.
A DP main link or a tunnel pixel clock is recorded as stopped, for its
user to start again. A domain that stays on sends no notification, for
example while a USB controller runs with a cable connected, and then
nothing changes. A debug line reports each restore, with the parked
PIPE registers.

Only apple,t8122-atcphy registers the notifier. On every other PHY no
power-down is ever recorded, so the resume callback and the check at the
start of each PHY operation do nothing.

[ryan: adapted to 7.2.10 — restore T8122 power-domain state inside current PHY/mux lock boundaries without replacing #353 root-hub, PIPE or retry ownership helpers]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 9004693)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The HDMI crossbar of T6030 is the only device in its power domain, so
the domain powers down during system sleep and the crossbar comes back
with its registers reset. The driver still holds the route as selected:
the DCP selects its fixed HDMI route once at probe, and the mux core
skips a select of the state it already holds. After resume the output
therefore has no route, and HDMI stays dark.

On T6030, rewrite the route field of every selected output on resume.
Leave the link clocks off: the PHY's link stays stopped until the DCP
configures it again, and the crossbar clocks have to follow the PHY. If
the clock enables of an output whose link was up did not survive,
record that link as down, so the DCP's next apple_dpxbar_link_up()
turns them on again in the right order.

Other SoCs return from the resume callback at once, so their behaviour
is unchanged.

[ryan: adapted to 7.2.10 — retain current 7.2 APIs and J700 ownership while layering this ordered source change]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 338c34b)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
A DP-to-HDMI converter on an SN201202x port can leave DATA_STATUS as it
was, HPD level included, when the display behind it is unplugged or
replaced. None of the events we unmask fires, so the display route never
hears of it: the old display's EDID and modes stay until the adapter
itself is replugged (seen on hw with a USB-C HDMI adapter on the M3 Pro,
monitors swapped behind it).

The controller keeps the DP status the partner sent last (DP Status
Update or Attention) in its DP SID status register, and signals each new
one with event bit 37. On SN201202x:

- unmask that event, and read the DP status when it fires;
- once it fired on a DP connection, HPD is low when that status shows it
  low, as well as when DATA_STATUS does;
- when the status went low and high again between two updates, send HPD
  low before the final state, so that the display route releases the old
  display and reads the new one;
- pass IRQ_HPD on from a new status even when the status sent last
  carried it too, by sending the status without it first.

Until the event fires on a connection, HPD comes from DATA_STATUS alone,
as before. CD321x leaves the event masked, so none of this runs on M1/M2.

[ryan: adapted to 7.2.10 — scope partner DP SID to non-H17 SN201202x; preserve #353 held-mux retry, retain coalesced edges on failure and current lost-IRQ recovery]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 5baceeb)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
When a DP alt mode cable is unplugged, the update puts the port in its
safe state, and the PHY, first in the mux chain, stops the DP lanes
before the display route hears of it. The display firmware shuts the
link down only after that, and on T6030 every unplug then logs "dpphy:
T602X clocks remain active" (seen on hw, all three ports): the crossbar
output is taken down after the link clock it gates has stopped.

On SN201202x, when a display route in use is about to go (the partner is
unplugged or replaced, or leaves DP or its pin assignment), send the DP
state with HPD low first. The display route releases the display while
the PHY still runs the link; the update then moves the PHY as before.

CD321x ports are unchanged.

[ryan: adapted to 7.2.10 — release legacy SN201202x display before PHY changes while preserving native H17 SAFE ownership and propagating held-mux release failures]

Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit 0ed9b82)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On the J613 SN201202x, the SWDF and SWUF commands can stay busy forever,
and a data-role swap then wedges the command mailbox. Refuse the swap
there with -EOPNOTSUPP and keep the negotiated data role.

Only J613 is affected; every other machine, including the M3 Pro with
the same controller, swaps as before.

[ck: the data-role-swap part of the J613 USB-C role and PHY recovery
 commit only; our role, PHY and sleep handling stay]

[ryan: adapted to 7.2.10 — retain current 7.2 APIs and J700 ownership while layering this ordered source change]

(cherry picked from commit 2b09b6a236b3fd016f69e513e3768d56c1e41086)
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>

(cherry picked from commit ea66b6b)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
ACIO activation completion uses the same CD321x notification as link
failure. Initial activation, one late failure and successful recovery
consume all three events, so a second late failure gets no fresh read.

Give activation readiness its own notification and pending flag. Only
wake a deferred busy-provider read, without spending or replenishing the
fault budget. Keep genuine failures sticky and give them priority over
coalesced ready events. Ignore healthy, suspended and removed sessions.

Cover completion/failure/completion/failure, exhausted busy reads,
failed recovery, lifecycle gating and readiness during queued apply.
The actual-header reproduction now permits the second failure's read.

Original patch by DJ (cd2525c).

[ryan: adapted to 7.2.10 — separate activation readiness from faults while retaining current ACK backoff, #353 held-mux state and all existing PM tests]

Fixes: 39176aa92190 ("usb: typec: defer CD321x revalidation while PCIe activation is busy")
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
(cherry picked from commit d59838c16a55d42b2cc537b1298afc814b7e23c6)

(cherry picked from commit 97b4e34)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Unregistering the Type-C provider does not revoke consumer handles. A
concurrent set can pass its cable request between notifier removal and
the worker drain, or wait on the ACIO lock and start a new host after
shutdown has finished.

Mark ACIO removing under its cable lock before draining either producer.
This waits for an in-flight set; later sets return -ESHUTDOWN before
touching cable state or starting work. Keep the existing worker disable
and shutdown ordering. A fresh probe gets a fresh removal state.

Original patch by DJ (2352652).

[ryan: adapted to 7.2.10 — serialize removal admission with current ACIO transition lock and retain Type 7 and DP binding state]

Fixes: 99168b100f76 ("thunderbolt: apple: drain activation notifications before unregister")
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
(cherry picked from commit 801b4a6ccbfc79fefd6650273a096c9635615e64)

(cherry picked from commit 0cb3485)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The CD321x resume worker collects a pending link fault and a pending
activation completion together, and handled the completion only when no
fault was pending. Once the link recovery budget is spent the fault is
refused, and the completion that arrived with it was dropped as well. A
port that had run out of reads while its provider was busy then stayed
stale until some unrelated cable event.

Handle the two independently in a cd321x_pm_notifications() helper. An
accepted fault already clears provider_busy, so a completion arriving with
it still changes nothing and the fault keeps its priority; a refused fault
no longer hides the completion. Add KUnit cases for a completion coalesced
with a refused fault and with an accepted one.

[ryan: adapted to 7.2.10 — retain current quiet diagnostics and PM retry state while accepting completion behind refused faults]

Fixes: d59838c16a55 ("usb: typec: separate activation completion from link recovery")
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
(cherry picked from commit 43bee20cd208f388c0bfedf0c461f0b6e5182dc2)

(cherry picked from commit 4909b69)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Commit 801b4a6ccbfc ("thunderbolt: apple: reject cable callbacks once
removal starts") refused every cable callback once removal began. A CD321x
update that turns the cable off then failed with -ESHUTDOWN and went into
recovery, although removal turns the cable off anyway. Accept OFF with 0
while removing, and keep refusing activation without touching cable state.

Also say what the removal guard does not do. It only covers callbacks
made while the ACIO still exists; it does not revoke the switch handles
consumers keep. A set after remove returns still reaches freed memory, as
before; only a manual unbind gets there. That commit's message reads as
if the guard closed that too: it narrows the window, it does not close it.

[ryan: adapted to 7.2.10 — retain current 7.2 APIs and J700 ownership while layering this ordered source change]

Fixes: 801b4a6ccbfc ("thunderbolt: apple: reject cable callbacks once removal starts")
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
(cherry picked from commit e380b15591fb7b624c77edffe6010b5c7e664e80)

(cherry picked from commit 5fba4a2)
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr and others added 22 commits October 20, 2026 00:41
J700 uses MAX98360A speaker amplifiers supported by this codec. Without it the machine driver defers on the speaker DAI link. Select it alongside the other required codecs so distribution configurations cannot omit it.

Signed-off-by: DjDeveloperr <43033058+DjDeveloperr@users.noreply.github.com>
(cherry picked from commit b406b95)
The previous commit reworded XART-SAFETY.md, which the Arch package ships
through a symlink, so its sha256sums entry no longer matched the tree and
test_packaging failed. Record the new sum, as updpkgsums would.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The firmware allocates its working memory through the SHAREDMALLOC
channel, and frees it on the same channel by sending the surface's
iova. The driver acknowledges a free but keeps the surface on the gc
list, and frees that list only when the firmware stops, because the
firmware does not free everything it allocated and may still access a
surface after freeing it.

Resident firmware never stops while the driver is bound, so nothing
it frees is ever freed. On J700 every camera session allocates its
SHAREDMALLOC surfaces anew: MemAvailable falls by about 85 MB per
session, from 3.2 to 1.5 GB over 20 sessions, until the ISP's IOVA
range is used up. Then the firmware's 0x484000-byte requests fail
("SHAREDMALLOC: handler failed: -12"), IO commands time out, and
REQBUFS returns -ENOMEM because the capture buffers no longer fit in
the IOVA range. Firmware started for each stream is not affected,
since every stream ends with a firmware stop.

Handle the free request: move the surface with that iova to a list of
released surfaces, and free those when the stream stops, after the
channel has stopped and its buffers have been returned, or when the
firmware stops. Waiting for the end of the stream keeps the surface
mapped while the firmware may still be using it. Surfaces the firmware
never frees are still freed only when it stops, and a free for an iova
the driver does not know is still acknowledged. A released log or
buffer return surface is no longer used to read firmware messages.
The firmware itself stays resident, as before.

Test the free request handling with KUnit. Compile-tested and KUnit
only; not yet run on hardware.

Fixes: 16a04f7 ("media: apple: isp: Keep resident firmware running between streams")
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
….11-unified

Topic head 6db5985, 171 commits not already in the tree.
Top commit: arm64: dts: apple: t8122, t6031: link the DCPs and the PMP report
…fied

Topic head c027832, 154 commits not already in the tree.
Top commit: pmdomain: apple: pmp-report: add KUnit fault injection for the PMP start
…nto rebase-wip/7.2.11-unified

c88aa43 ("usb: typec: tipd: Descend into tipd/ whenever the core is enabled") fixes a link failure of
asahi-wip itself with the J700 configuration. Merged ahead of its topic so
that every first-parent commit of rebase-wip/7.2.11-unified links; the 170-usb merge brings
the rest of that topic.
…ified

Topic head 0fa6bbb, 44 commits not already in the tree.
Top commit: iommu: apple-dart: Test legacy and 5-cell DT windows
…ified

Topic head 8dc68ea, 21 commits not already in the tree.
Top commit: nvme: apple: queue controller recovery on system_dfl_wq
…7.2.11-unified

Topic head eb7a105, 48 commits not already in the tree.
Top commit: soc: apple: finish the merge of DART, QSPI and SMC hwmon
…nified

Topic head 8303b55, 83 commits not already in the tree.
Top commit: ASoC: apple: select the MAX98357A codec for macaudio
…nified

Topic head a8a604c, 194 commits not already in the tree.
Top commit: wifi: brcmfmac: describe the scan timeout KUnit module
…nified

Topic head 8493abe, 50 commits not already in the tree.
Top commit: HID: magicmouse: document the host-driven click members
…fied

Topic head 5c81bbc, 382 commits not already in the tree.
Top commit: tools: aurora-sep: Refresh the Arch PKGBUILD sums for XART-SAFETY.md

Conflict resolved in MAINTAINERS (ARM/APPLE MACHINE SUPPORT): 060-power-thermal
widens the hwmon pattern to macsmc-hwmon*.c and 100-sep moves the
drivers/pmdomain/apple/ line to its sorted place; keep both, as aurora-wip has it.

Unified 900 review: retain the current macsmc-hwmon*.c coverage and drivers/pmdomain/apple/ entry in the sole MAINTAINERS conflict. Keep every nonconflicting SEP entry from the three-way merge. The narrower old hwmon filename and stale removal of pmdomain coverage are not improvements. Exact base/ours/theirs blobs are recorded in MAINTAINERS.sides.
Re-recorded when 010-soc added the pmp-report KUnit config line; the rule is unchanged.

drivers/soc/apple/aop.rs: keep the assembled side. 070-audio's
AOP service registration runs from its own registration queue behind the
removal gate; 100-sep's only change there is the system() ->
system_dfl() workqueue switch, which that queue already supersedes.
Asahi's Interchange support advertises DRM_FORMAT_MOD_APPLE_INTERCHANGE
on the primary plane and on every overlay but the top one, on every
DCP. It was brought up on the M1 and M2 generations; scanout of an
Interchange framebuffer has not been tried with the H17P firmware that
the T8140 (J700) and T8122 DCPs run, and a compositor that sees the
modifier will pick it for direct scanout.

Leave the modifier out on H17P firmware until it has been tested there,
so those planes keep advertising linear framebuffers only. The primary
plane now follows the same interchange argument as the overlays; on
other firmware it is set for the primary plane as before.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…fied

Topic head db09d8d, 280 commits not already in the tree.
Top commit: reset: apple-cio: build the CIO reset driver by default on Apple

Unified assembly resolutions (900 lane):
- include/linux/soc/apple/pmp-report.h: keep both additions. 010-soc
  b56195a145e5 adds apple_pmp_report_wait_supplier_ready(); 170-usb
  2af69d67f3b3 (from 4336e52) adds apple_pmp_report_wait_ready().
  Both prototypes and both !CONFIG_APPLE_PMP_REPORT stubs are kept.
- include/linux/soc/apple/pmp.h (add/add): keep the 010-soc header. It
  declares the same apple_pmp_link_device() and
  apple_pmp_set_device_power() prototypes as 170-usb, plus their
  !CONFIG_APPLE_PMP stubs and the PMP driver's registration API, which
  170's subset omits.
…fied

Topic head 9611791, 422 commits not already in the tree.
Top commit: drm: apple: advertise Interchange only where it was qualified
…fied

Topic head 72844db, 175 commits not already in the tree.
Top commit: drm/asahi: uapi: use integration/aurora's wording

Unified assembly: keep the current 010-soc RTKit file. The GPU topic changes only start_ep to return the send result relative to its merge base; current 010 already propagates that result and adds one retry only for an unsent -ETIMEDOUT. Retain all current OSLog Neo/M5/sync no-ACK policy, adopted session, kdebug and teardown changes. No GPU-specific RTKit delta is lost.
Re-recorded (900 lane) when the current side gained
apple_rtkit_flush_rx(); the resolution is still the current side verbatim.
…11-unified

Topic head 66215d2, 108 commits not already in the tree.
Top commit: arm64: handle Apple M4+ wait state without boot flags

Conflict resolved in drivers/gpu/drm/drm_gem_shmem_helper.c as in the 210/220
test merge 5bc189ffceb3: the shared drm_gem_shmem_object_offset() line once, and
in drm_gem_shmem_mmap() 220's byte-range validation before 210's revocation
check, which is aurora-wip's order.
Re-recorded after the 220 review fixes (#136): same rule, with 220's
validation now covering a partial native-page PRIME offset.
…fied

Topic head bc8f2cd, 82 commits not already in the tree.
Top commit: media: apple: isp: Free the shared surfaces resident firmware releases
…fied

Topic head 5829ea5, 29 commits not already in the tree.
Top commit: accel/ane: queue the boost release on system_dfl_wq
…/7.2.11-unified

Topic head 65d92f9, 91 commits not already in the tree.
Top commit: selftests: Register Aurora host tools and the AFKV2 target
Every unified topic rebased from asahi-wip 6d20a31 (v7.2.10) onto
e09c628 (v7.2.11), and assembled the same way. The tree is the
canonical unified assembly on 7.2.11, the second parent. The first parent
is integration/aurora 44d5afc, which this replaces, so the branch
merges into it cleanly.

Conflict work in the rebase:

- 090-input: dockchannel-hid keeps 7.2.11's ordered dchid-new workqueue
  after our wakeup set-up; our own unbound-workqueue change is dropped,
  superseded by Asahi's fix of the same 7.2 warning.
- 220-userpages: copy_vma() takes both the per-process page offset and
  7.2.11's keep_source (the MREMAP_DONTUNMAP self-merge fix), in mm and
  in the VMA userland test.
- 200-dcp: apple_plane_init() takes both our supports_xrgb2101010 and
  Asahi's Interchange argument; the T6030 14.7 primary plane uses the
  linear-only modifier list.
- 900: asahi.config now enables the CIO reset driver itself, so only the
  J700 fragment sets it built in.

New: Interchange is not advertised on H17P firmware (T8140, T8122) until
it has been qualified there.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Collaborator Author

7.2.11 (bd526b3c11cc) is qualified on the Neo (J700) and is now its daily kernel, with #12 as the first rollback.

  • Same build: the config is identical to Aurora kernel roadmap: priorities, current evidence and acceptance #12 apart from the version, and the DTB is byte-identical. Driver bindings match, and there are 0 WARN/Oops/DART faults.
  • GPU: Mesa 26.3-devel (73c9678) on G17P. The ray-tracing extensions are present; vkcube and es2gears run; 0 submit EINVAL, 0 device lost, 0 GPU faults.
  • Displays: the hotplug/unblank legs pass (10/10, 5/5, 6/6). s2idle residency is about 99.2 %.
  • Touch ID: ready across 5×30 s s2idle. It restores at boot with 0 retries on the daily boot; the kit boot needed 3 bounded attach retries.
  • PMP and thermal behave as on Aurora kernel roadmap: priorities, current evidence and acceptance #12. A 40-session ISP check shows no memory growth, with every surface the firmware released freed.
  • Rest of the sweep: Wi-Fi, BT, camera, mic, USB-C, wake and AOP all pass.

The ref Macs (M1 Pro, M2) are next.

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.