Repository navigation
Merge integration/aurora 695d9745 into aurora-wip (SEP boot policy change) - #585
Merged
Merged
Conversation
Provide the APIF MMIO transport, DART/SART ownership backends, T6050 CPU identification, shared RTKit/mailbox support, and common consumer interfaces on Linux 7.3. The native platform drivers continue to use their existing paths. Shared headers, build declarations, documentation, and host-test support let the remaining driver changes be reviewed as sibling PRs. Source snapshot: t6050-gpu ee68abb105200e99636a5edfc647a5cfc1d89954 Integration base: 9cbdd07 Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
aurora-sep-greeter-fingerprint.service held gdm back until aurora-sep-ready.service finished, so the login screen would find the reader and its fingerprints. The enclave takes tens of seconds after boot, and when it does not come up the job timeout holds gdm until 90 s after boot. On the J616s the desktop appeared at 95 s; with automatic login that wait bought nothing at all. The greeter unit now only prepares the login screen's shell and no longer waits for Touch ID. A new aurora-sep-greeter-refresh.service runs once both gdm and Touch ID are up. When nobody has logged in yet, it shows the login screen again so it asks fprintd for the reader again and offers fingerprint. With automatic login, or once anyone has logged in, it changes nothing, since restarting gdm would end their session. Enabling the greeter unit enables the refresh unit with it. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new Stage 1 changes the boot policy the Mac keeps for Linux. The first time Linux's identity keybag is unlocked under the new policy, the enclave rewrites one session record that already existed. Linux did not create it, so the xART guard refuses the write. The enclave then never answers CHANGE_LOCK_STATE, the machine ref-key stays down and every trusted-key seal fails with EIO, so Touch ID is gone until the policy changes back. On a J616s (T6040) this happened after a Stage 1 reinstall that changed only the kernel collection hash. Under an unchanged policy that first unlock rewrites no session record at all, so a rewrite inside it is the policy change. Let exactly one through: during the first unlock of an identity keybag that already existed, once per boot, one kind-4 session record, a rewrite and never a delete, and only once the record's previous value is durable in a host file. The record is not added to Linux's list. A ref-key created this boot closes the window. For a change the window does not cover, aurora-sep-policy-change leaves a one-time allowance in /var/lib/aurora-sep-xart-allow-once.bin naming the refused record, or before a planned change the first existing kind-4 record asked for. The driver empties the file at probe before it uses it, so an allowance lasts one boot, on the same terms. Name refused records by their session id. Linux's list of records already holds session ids, so this reveals nothing new. On the J616s the allowance restored Touch ID with the existing enrolment: one kind-4 record and one shared root were rewritten, the other seven session records kept their revisions, and the enrolled finger matched. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r hold the boot for it aurora-sep.service was ordered before multi-user.target, so a boot whose enclave did not come up waited for the loader's full two-minute timeout. On a J616s after a Stage 1 reinstall, userspace took 2 min 1.6 s. It now has no ordering before multi-user.target. fprintd and aurora-sep-ready still wait for it, and the login screen no longer does. aurora-sep-load retried the seal every 100 ms for those two minutes even when the xART guard had refused the enclave's write, which does not go away by waiting. It now stops at the first refusal and says what happened and what to run. The same J616s reached graphical.target in 11.1 s, with one seal failure logged instead of about 1,100. The driver now follows a boot policy change by itself. When it logs that it did, aurora-sep-load notes the m1n1, iBoot and OS firmware versions the boot came up with. For a change it could not follow, aurora-sep-policy-change backs up the gigalocker, the driver's host files and the fingerprints, then arms the driver's one-time allowance: with no arguments for the record this boot refused, or with --expect before a planned change. XART-SAFETY.md describes the event, the automatic update and the allowance. The Arch package also gets the aurora-sep-greeter-refresh.service link that its PKGBUILD already lists. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…retire On DARTs with a firmware root mirror or handoff, retiring a locked root runs a range invalidate of the slots Linux published. apple_dart_hw_unmap_locked_ttbr() dropped its result, returned 0 and cleared the root. The invalidate that apple_dart_domain_free() checks afterwards then found no root, issued no command and returned 0, so the domain's page tables were freed even after a TLB timeout, while the hardware could still cache translations through them. Before the handoff DARTs took that path, a whole-stream flush there returned the error and the page tables were kept. Return the first retire-time invalidate error, and remember it per stream on the DART. apple_dart_domain_free() keeps the page tables when its own retire or invalidate fails, and also when a consumer release or an attach rollback retired the root first and its invalidate failed. The remembered error is never cleared, because only the hardware could show that the TLB no longer holds those entries; later domains on that stream keep their page tables too. The host fixture now builds apple_dart_hw_unmap_locked_ttbr(), apple_dart_release_device() and apple_dart_domain_free(), and forces the TLB command to time out for a direct free, a release before the free and a rollback before the free. Each keeps the page tables, and the timeout cases fail on the old code. A comment in apple_dart_check_fw_map() now says the firmware leaf is checked, because only the root entry is snapshotted. The message of ff5c39a ("iommu/apple-dart: keep stream invalidates out of handed-off slots") also lists resume as a user of the stream invalidate, but apple_dart_resume() returns early for locked DARTs, and handoff requires a locked DART, so resume never reaches it. In this tree the fixture also stubs apple_dart_has_borrowed() and the DCP domain fields that apple_dart_release_device(), apple_dart_t8110_hw_invalidate_tlb() and apple_dart_domain_free() read; no borrowed display root is involved in these cases. Signed-off-by: DjDeveloperr <hey@djdev.me> (cherry picked from omacom/linux-aurora commit 07d64c6)
LEAKED_GRAPHS was added between keep_graph()'s doc comment and the function, so rustdoc attached "Keeps `graph` until the firmware stops..." to the static. Move the static above that comment. Signed-off-by: DjDeveloperr <hey@djdev.me> (cherry picked from omacom/linux-aurora commit 5389bde)
Both kill paths set the context's kill-published flag only after a fallible step that follows the irrevocable publication: record_render_kill(...)? on the render-only path, and the compute queue lookup's .ok_or(EIO)? on the compute path. Neither can fail today, because the candidate checks rule those cases out under the same device mutex, but the at-most-once rule should not depend on that. Set the flag as soon as publish_control() succeeds. Signed-off-by: DjDeveloperr <hey@djdev.me> (cherry picked from omacom/linux-aurora commit 8a7ef5d)
External displays had no HDR mode on the M4 Pro: the firmware-derived EDID of the T6041 external processors is a base block alone, and their connectors carry neither a Colorspace nor an HDR_OUTPUT_METADATA property, so GNOME and KWin never offer HDR. The firmware reports what is needed. DisplayAttributes says whether the sink takes a PQ signal and HDR static metadata, whether it takes BT.2020 RGB, and its luminance range. Each timing lists PQ color elements next to its SDR ones, with the elements its link cannot carry. Use it: - Parse SupportsPQEOTF, SupportsHDRStaticMetadataType1, SupportsBT2020RGB and Luminance from DisplayAttributes. A malformed optional key reads as absent; the sink identity still stands. - When the sink takes PQ, extend the firmware-derived EDID with a CTA-861 block: a colorimetry data block (BT.2020 RGB) and an HDR static metadata data block (SDR and SMPTE ST 2084, static metadata type 1, and the luminance range coded per CTA-861.3). - Keep, for each timing, its best PQ BT.2020 element the link can carry: full range RGB first, 10 bits per component first, then YCbCr 4:4:4, which the processor converts the RGB surfaces to. - Give external DisplayPort and HDMI connectors a Colorspace property (Default, BT2020_RGB) and HDR_OUTPUT_METADATA. A change of either is a mode set. - Refuse an EOTF other than SDR or PQ, and PQ on a timing without a PQ element or on a processor other than the desktop 26.x one. - On a PQ commit, set the timing's PQ element and tag RGB surfaces BT.2020 with the HDR transfer function, so the processor takes the PQ code values the compositor wrote as they are. The internal panels, the other processors and SDR output are unchanged. The firmware sends the HDR infoframe or SDP itself; the mastering metadata a compositor supplies is not forwarded. Tested on the J616s (M4 Pro, desktop 26.6 firmware) with an Acer QG270 S3. GNOME 51 offers HDR (bt2100) for it, and the monitor enters HDR mode: over HDMI at 1080p60 (PQ BT.2020 RGB, 10-bit) and 1080p120 (PQ BT.2020 YCbCr 4:4:4, 12-bit), over DisplayPort at 1080p180 (PQ BT.2020 RGB, 10-bit). HDR at 144 or 180 Hz over HDMI is refused, as the firmware has no PQ element that link can carry there. The internal panel keeps its SDR mode only. The apple-dcp host selftests cover the CTA block, the parsed HDR keys and the PQ element choice. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The external display processor of the A18 Pro (T8140, H17P) sets its modes through the same IOMFB template as the desktop 26.x firmware and builds its EDID from the same DisplayAttributes, so the HDR path of the desktop processors applies to it as well. Collect the PQ element of each timing on its external SDR parse path too, which keeps choosing its SDR element as before, and let its connector take a PQ commit. On a PQ output its RGB surfaces are tagged BT.2020 with the HDR transfer function before the sRGB source tag of the H17P external SDR path applies, which then leaves them alone. Not yet tested on hardware: the Neo was not available. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
A desktop 26.x processor whose output is a Type-C route gets a connector of its own, of the USB type, and drives DisplayPort over it. Give it the DisplayPort Colorspace property and HDR_OUTPUT_METADATA as the DisplayPort and HDMI connectors have, so a USB-C display on such a route is offered HDR the same way. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
drm/asahi: G17 kill flag order and keep_graph() doc comment
… back The GPU floor is released while the PMP limits the DCS and comes back APPLE_CLPC_GPU_BACKOFF_MS after it last did. The debugfs status shows when the PMP last limited the DCS, but not how often the floor changed, so a backoff that is too short, letting the floor flap during sustained heavy rendering, is not visible. Count, at each sample that sees GPU work stream, the times the floor went from held to released and back, and show both counts in the status file. Two readings around a heavy run then show whether the floor came back while the PMP was still limiting. In this tree the GPU floor branch also sets the sample's reason bit 4; that is kept, now inside the counted branch. Signed-off-by: DjDeveloperr <hey@djdev.me> (cherry picked from omacom/linux-aurora commit 8945c4c)
…utilization The G17 mailboxes receive in a threaded IRQ handler, which runs as an RT thread. RT threads run with the RT default minimum utilization, 1024 unless the system lowers sched_util_clamp_min_rt_default, so schedutil raises the thread's CPU cluster to its top frequency for every message. For the GPU completion mailbox that means one top-frequency burst per GPU completion, also while the GPU itself is the bottleneck and the CPU has nothing to do quickly. Add apple_mbox_set_rx_util_min(), which records the minimum utilization a consumer wants for the receive thread, or -1 for the scheduler's default, and have the threaded handler apply it to itself (sched_setattr_nocheck() on current, keeping its policy and priority) the next time it runs. The request is a single store, so it may be made from any context. Only mailboxes with a threaded receive handler support it; until a consumer asks, the thread keeps the default. Wrap it for RTKit consumers as apple_rtkit_set_rx_util_min() and RtKit::set_rx_util_min(). RtKit::rx_util_min_handle() returns a handle that makes the same request without borrowing the RtKit, for consumers that update it from their submission and completion paths. A KUnit case covers the request checks, and applying a request to a FIFO thread without changing its policy or priority.
…e GPU is the bottleneck Every G17 completion arrives through the primary coprocessor's mailbox, whose receive thread is an RT thread. With the RT default minimum utilization, schedutil raises its CPU cluster to the top frequency for each completion. While the GPU itself is the bottleneck that burst gains nothing. On J700, during GPU-bound work the P-cluster sits at its top frequency in about half of 1 s samples although the CPUs are about 3% busy, and once the SoC reaches its thermal limit (within about 40 s of heavy work) that power comes out of the GPU's clock. Have the feed detector also recognize when the GPU is the bottleneck: at least eight passes in a row whose refill gaps stay under a quarter of their busy time, the complement of its host-refill-bound test, lingering 8 ms like that state. While it holds, the port asks for a minimum utilization of 256 for the receive thread, and for the scheduler's default otherwise. The port re-evaluates at every publication and completion through a lock-free RTKit handle, so after a pause the publication that ends the state restores the default before its completion arrives. There is no new work item or timer. Lowering the boost whenever the feed is not streaming is not enough. The completion that ends a short pause then runs slower too: idle.wake with 2 ms gaps took 5% longer even at a floor of 512. A floor of 0 instead of 256 costs single-submit heavy compute about one completion per 250 ms. Measured on J700 with the panel off, in one boot after a 45 s heat-up, the old and new behaviour strictly alternated five times (gpubench, microseconds per submit, mean of the per-round medians; lower is better): render.heavy fill 2160p d1 2817 -> 2723 -3.3% render.heavy fill 2160p d16 2655 -> 2577 -2.9% render.heavy fill 1080p d1 802 -> 780 -2.7% compute.heavy alu d16 1199 -> 1179 -1.7% compute.heavy alu d1 1374 -> 1375 (one window in five) idle.wake 2 ms / 20 ms 191 / 588 -> 191 / 590 (medians) render.light d1/d32, compute.light d1/d8, compute.light queues d2, sync.signal binary queues within run-to-run noise On the heavy rows the P-cluster's mean frequency drops from 2.5 to 1.0 GHz and system power by 0.4-0.5 W. A KUnit suite covers the detector's three outcomes.
The internal panel of the M4 Pro MacBook Pro reaches 1600 cd/m2 for HDR content, but its processor describes it with a single SDR color element, and no PQ link mode exists for it. macOS shows HDR there as EDR instead: SDR white keeps the panel level the user chose, and every swap carries the display EDR scale (SDR white over the peak) and the headroom the frame uses (the peak over SDR white), so the processor can raise the backlight and leave SDR content where it was. The processor reports the panel's peak luminance through max_panel_brightness (A128), in 16.16 cd/m2. It also takes PQ BT.2020 surfaces on this path and maps them into the headroom. Do the same: - Ask for the peak during start-up, before is_main_display. A peak above the panel's SDR maximum enables EDR. - With it, give the panel EDID the CTA-861 block of the external displays: BT.2020 RGB, SDR and SMPTE ST 2084, static metadata type 1, the peak as maximum and frame-average luminance. - Give desktop 26.x eDP connectors the Colorspace and HDR_OUTPUT_METADATA properties, and accept PQ on the panel when its peak is known. The panel keeps its SDR mode. - On a PQ commit, tag its RGB surfaces BT.2020 with the HDR transfer function and put the EDR scale and headroom, binary64 values at +0x37e and +0x3e6 of the swap flagged by bl_flags[2] and [4], into each swap, computed from the current panel level. The first swap after PQ ends sets both to 1. Other panels and processors are unchanged. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The power allocator only budgets power actors on its passive trips. A cooling device without power callbacks, such as a fan, mapped to an active trip of a zone the power allocator governs was never set, so a device tree fan curve did nothing on kernels that make it the default governor. Run those cooling devices the way the bang-bang governor does: when the zone reaches an active trip, each such instance asks for its upper state, and when the zone falls below the trip minus its hysteresis it asks for nothing. A cooling device mapped to several trips takes the deepest state asked for, so a ladder of active trips gives a stepped fan curve. Instances that have no target yet (a cooling device bound after the zone passed the trip, or after resume) are set from the zone temperature on the next update. Power actors are left to the power allocator as before, and zones without active trips are unchanged. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
With #cooling-cells = <3> the SMC hwmon node provides its fans as cooling devices, named by their index among the fan-* nodes as in <&smc_hwmon fan-index lower upper>. State 0 leaves a fan to the SMC; the other states run it at speeds spread from its minimum to its maximum. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
drm/apple: Drive HDR output on desktop 26.x external displays
…e-error iommu/apple-dart: keep page tables after a failed invalidate at root retire
When the TLB invalidate that retiring a locked root needs fails, the DART remembers the error per stream (locked_retire_err), and apple_dart_domain_free() keeps the page tables of every domain on that stream until reboot. Nothing said so until a domain was freed, and then only as a ratelimited "retaining page tables" error per free. Log a warning the first time a stream records such an error, naming the stream and the error and saying its page tables are kept. The error is never cleared, so this fires at most once per stream. The host fixture counts the warning in the timeout cases, and a new retire-repeat-timeout case checks that a second failed retire on the same stream keeps the first error and does not warn again. Signed-off-by: DjDeveloperr <hey@djdev.me>
On the M4 Pro MacBook Pro (J616s) the SMC keeps both fans in its own mode 3. With no operating system asking it for cooling, it leaves them off, or switches them on late and ramps them slowly, while the dies heat up: four busy CPU cores took the CPU die from 52 C to 95 C in two minutes with both fans at 0 rpm. Linux has to ask for the cooling. With #cooling-cells = <3> on the hwmon node, every fan registers a cooling device, named by its index among the fan-* nodes. State 0 leaves the fan to the SMC; states 1 to 8 run it at speeds spread evenly from its minimum to its maximum, through the same manual mode and Ftst unlock as the fan_control target, which they do not need. A fan runs at the higher of the userspace target and its cooling state, so userspace cannot take it below what the thermal zones ask for, and it goes back to the SMC once neither asks for anything. Unlocking takes the SMC seconds, so states are applied from a work item. Any failure leaves the fan with the SMC. Suspend, shutdown and removal stop the work and hand every fan back; resume applies the cooling states again. Without #cooling-cells nothing changes. KUnit covers the state to speed mapping, cooling without fan_control, cooling together with a userspace target, the stopped state and a failed unlock. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Make both J616s fans cooling devices of the CPU die zone and the seven GPU zones. Each zone gets a ladder of active trips: 75 C runs the fans at their minimum, 80 C, 85 C and 90 C step them up, and 95 C runs them at full speed. A fan takes the highest state any zone asks for and returns to the SMC once every zone is 10 C below the first trip. The first trip sits above the 70-75 C the CPU die touches for a moment during light desktop bursts, so the fans do not start for those. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
iommu/apple-dart: warn once per stream when a retire invalidate fails
An MSI MPG 325CQRXF on the second external processor of the M4 Pro came up with an empty EDID: no monitor name and no HDR capability in userspace. Its DisplayAttributes report the red primary as x 0.6904, y 0.3203, the 10-bit values 707 and 328 of its own EDID. Their sum is above 1, and the parser refused any chromaticity whose coordinates sum above 1, so the whole of DisplayAttributes was dropped and no EDID was built. Primaries are the sink's description of itself, and real EDIDs carry such values. Pass them on as reported. The EDID builder still requires each coordinate to be representable, the primaries to span a triangle and the white point to lie inside it; the white point, which the gamma belongs to, must still be a chromaticity. The same sink reports its luminance without a minimum. Read a missing minimum as 0 and a missing frame-average maximum as the maximum, rather than dropping the luminance range. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On T8140 the GPU floor (DCS 4, fabric 3) follows graphics power: work that keeps graphics powered for 64 ms streams and gets it, while frame-paced loads power graphics up and down and leave it down. Light submissions a few milliseconds apart also let graphics power off between them, so they never stream, yet each of them waits on the fabric, which with the panel off nothing else holds up. Count the GPU driver's submissions through the host activity input that T6040 already uses, and give the floor to work with two or more submissions in each of four sampling periods in a row (16 ms, one 60 Hz frame). A frame-paced load leaves a quieter period in every frame and stays below. The floor keeps the PMP back-off and the vote hold of streaming work. On T8140 a cold publication does not sample at once, as it does on T6040, where the publication is the demand. Such a sample at the start of each frame of video playback finds the CPUs busy and holds the DCS up through their vote. debugfs counts the samples that applied the floor for streaming and for dense work. The T8140 GPU node now links its CLPC. Device trees without that link still find the single T8140 CLPC, as a hint the GPU probes without.
GNOME brings the J616s panel up at 60 Hz with a fixed refresh whenever it makes a new monitor configuration: it takes the mode the kernel marks preferred. The panel's firmware ranks its 120 Hz timing first (IsPreferred, highest score), and the parser marks that one, but the takeover trial set the boot-like 60 Hz mode first and then moved the preferred mark to whichever mode it accepted, so 60 Hz it always was. Try the preferred mode first and the boot-like one only if it fails. The mode that worked stays the preferred one, as before, and is now the panel's native 120 Hz. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…ht-20261028 soc: apple: clpc: give dense light GPU work the T8140 GPU floor
…resh An external display came up in the timing its EDID lists first: the firmware marks that timing IsPreferred, and the parser preferred IsPreferred timings, then the highest score. On an Acer QG270 S3 that is 1920x1080 at 60 Hz of a 180 Hz panel; an MSI MPG 325CQRXF marks 1920x1080 at 240 Hz and 2560x1440 at 60 Hz, and the score picks 1920x1080 for a 2560x1440 panel. Default an external display to its native resolution at the highest refresh rate it can take, as other systems do: the native resolution is the largest the firmware marks IsPreferred (the largest of all when it marks none), and among its timings the higher refresh rate ranks first, then IsPreferred, then the firmware score. A timing whose SDR color elements are all unsafe or DSC only is never the default. Panels keep the timing their firmware prefers. The host selftests cover the three cases with synthetic catalogs modelled on both displays and a panel. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…obing them again The T6041 stage enables dcpext1, the processor that registers the routes' Type-C mode switches, only once the PMP is bound. The Type-C port controllers usually probe before that. The Type-C core passes over a mode switch inside a disabled node, so they took only the USB muxes, and once dcpext1 was bound the stage probed each of them again to take the display ones too. Probing a port controller again unbinds it first, and its remove drops the USB role, so dwc3 removed its xHCI host and the PHY went to sleep. That happened about 7.7 s into every such boot, right after the SuperSpeed root hub had registered and while udev and the devices behind a dock were being enumerated. The host came back about 1.4 s later. On the J616s with a dock attached, boots now and then stopped there, with PID 1 making no further progress. Add a supplier link from each port controller wired to a route to the processor that registers that route, when the stage prepares the tree. The device core then defers the port controller until the processor is bound, so it probes once and takes every mux it is wired to, and USB comes up once. If the stage falls back to the internal panel, drop the links and attach the port controllers, which then probe with the USB muxes as before. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
firmware: Add the shared T6050 APIF platform base
…reprobe soc: apple: display gate: let the port controllers wait instead of probing them again
nvme-apple: send a shutdown notification at final shutdown on post-M4
drm/apple: Default to native refresh on panels and native resolution at full refresh on external displays
The Aurora Mesa that omacom/mesa is syncing (omacom/mesa#19) defines feature bits 17 to 24, 26 and 28, command types 5 to 7 and DRM_ASAHI_BIND_SPARSE_TILE for the M5 (G17G/G17S) runtime. This header defines none of them. Mesa only uses each one after the kernel reports its feature bit, and this kernel never does, so nothing runs today. But if one of those numbers were later given to something else, Mesa would take an M5 path this kernel does not have. Reserve them under Mesa's names and values. Each entry says it belongs to the M5 runtime, and the comment before the feature bits notes that bits 25 and 27 are reserved for it too. This kernel already rejects the command types and the bind flag with EINVAL, and it reports none of the feature bits. Signed-off-by: DjDeveloperr <hey@djdev.me> (cherry picked from omacom/linux-aurora commit 0a449af)
A compute publication with two or more unretired commands of its queue ahead of it withholds its doorbell. Only the compute scan of a later event pass rings it, once at most one command ahead lacks a completion record. Nothing guarantees that such a pass comes: if the last event pass for the commands ahead runs before that condition holds, the firmware sits idle on a command it was never told about, and every waiter on that command stalls until an unrelated firmware message runs the scan. Under a Vulkan game in a muvm guest (DXVK on Honeykrisp, which runs buffer copies as compute) this shows up as GPU-wide stalls of 330 to 400 ms, about ten a minute under steady input. Probes on the GPU mailbox show the firmware sending nothing for the whole stall. Each one opens right after a compute publication and ends when the compute scan rings a withheld compute doorbell, after which the queued work runs at once. The compositor's own frames stall with it. The follow-up commits closed some of the ways into this state (job timeouts, recovery, a record waiting for its stamp) but not the lost wakeup itself. Remove the withholding and everything built on it, so that every compute publication rings its doorbell again. This gives back the few microseconds per hop the withholding saved in a cross-queue semaphore ping-pong. This reverts: 3ff8c49 ("drm/asahi: withhold G17 compute doorbells behind two unretired commands") b1f5dc6 ("drm/asahi: drop G17 compute doorbells that another doorbell announced") d38cce2 ("drm/asahi: announce withheld G17 compute doorbells whenever retirement stalls") 7012a59 ("drm/asahi: announce withheld G17 compute doorbells after a recovery") 5de99fc ("drm/asahi: keep withholding G17 compute doorbells while a stamp is awaited") 83ff3a9 ("drm/asahi: restart a withheld G17 compute doorbell another doorbell covered") Fixes: 3ff8c49 ("drm/asahi: withhold G17 compute doorbells behind two unretired commands") Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
drm/asahi: reserve the M5 UAPI feature bits, command types and bind flag
A render group whose completion stamps stall retires on its pass record after STAMP_FALLBACK_NS. The comment said the stamps follow the cache maintenance after a pass, but not that this path has no such evidence: whether the firmware completes the maintenance before it advances the done cursors is not known. Say that a group retired this way relies on the 50 ms bound for its counts, stores and exported timestamps to be visible. Comment only. Signed-off-by: DjDeveloperr <hey@djdev.me>
drm/asahi: g17: say what the stampless render retirement relies on
soc: apple: sep: keep Touch ID across a boot policy change
A context has 63 work-state nodes. All engines of one ioctl share its node, which returns only once every command of the ioctl has retired. That leaves a deadlock open when render and compute work share a context. Render admission takes nodes for newer ioctls (a render plus a compute command) as their renders retire. Each node stays held until that ioctl's compute command completes, and that command sits in the compute queue behind an older compute ioctl that has no node yet. Once render admission holds every node, the compute queue can admit nothing: the commands that would return the nodes are behind it. gpubench-stress queue.depth hits this on a Neo (A18 Pro). It keeps 128 compute and 64 render submissions in flight on one queue, each render followed by a compute copy. Debugfs capacity samples taken every 10 ms show the following. Within 50 ms of the start, the context holds 63 of 63 work states. No compute or render command is active and every published command has completed. The compute queue's next command and the render queue's next render loop between prepare and wait. After 15 s the client times out. An engine now never takes the last free node while it already holds one. The other engine can always take a node, and an engine refused that way waits only for nodes it took for ioctls ahead of its waiting command. Each engine admits a context's ioctls in submission order. Such waits therefore cannot form a cycle: an ioctl held by render that waits on compute would have to be both older and newer than one held by compute that waits on render. The decision is serialized under the context's work-storage lock, which initialization already took. The lease records which engine took its node. Signed-off-by: DjDeveloperr <hey@djdev.me>
…-reserve drm/asahi: g17: keep a work-state node for the other engine
… order Each engine admits a context's ioctls in submission order, but the render and compute engines advance independently. Under deep mixed load, render admission takes work-state nodes for ioctls far ahead of an older ioctl that is still waiting for its turn on the compute queue. gpubench-stress queue.depth keeps 128 compute and 64 render submissions in flight on one queue, each render followed by a compute copy. On a Neo (A18 Pro), every completion of the context stops within 0.5-4 s: compute and render-pair stamps stop together, newly published compute never runs, and the client loses the device. Capping the context's live nodes at 32, 48 or 56 does not prevent this. Native macOS on the same machine and firmware runs the same load (one MTLCommandQueue, 128 compute and 64 render command buffers in flight, each render followed by a compute copy) for 60 s without an error. Metal schedules a queue's command buffers in commit order across engines, with at most 36 between scheduling and completion. An ioctl now takes its node only while at most 8 older ioctls of its context have neither taken one nor left without one. Native scheduling happens at commit, on one thread. Here each engine admits from its own scheduler, so a strictly ordered turn costs a scheduler round trip whenever the other engine's ioctl is ready first; that slowed a windowed Vulkan client. Under the queue.depth load, run-ahead limits up to 16 held and 32 did not, so 8 leaves a factor of two. The turn is tracked under a context mutex taken inside the work-storage lock. Ioctls that fail or are cancelled before taking a node are remembered within 1024 ordinals of the turn. One that leaves further ahead makes the context's admission unordered, as before, rather than stall it. A refused publisher waits on its engine's admission domain, and the turn moving past a refusal wakes both domains. Contexts whose ioctls are never refused, such as single-engine ones, take no wake-ups from this. The last-node rule stays: render ioctls still hold nodes while their copies wait in the compute queue. Link: aurora-silicon/gpubench#5 Signed-off-by: DjDeveloperr <hey@djdev.me>
drm/asahi: g17: admit a context's ioctls to work states in submission order
…d's node The firmware stores the completion stamps of an ioctl's commands only once every kick counted on the ioctl's work-state node has completed: a node's completion word reaches the host's submitted count, and only then do the compute and render stamps move. A command whose record or pass record is present therefore waits for its stamp for as long as the rest of its ioctl runs. A command buffer of a dozen render passes and their copies, or a compute command beside a render that waits on another queue, keeps the stamps of its early members back for tens to hundreds of milliseconds. The 50 ms stampless fallback measured from the record, so it retired those members on their records while the firmware was still running their node: their fences, their VM pins and their render leases were released before the post-maintenance stamp the retirement path otherwise requires. On the Neo, one CTS synchronization2 pass retired about 9.8k compute commands this way. Each of them had kicks of its own node still running (the node's completion word below the host count), and the stamp covered it 4 to 300 ms later (median 28 ms). Count the bound from the drain instead. Once it has passed, a compute command or a render group whose stamps lag asks its node whether every counted kick completed; if not, the stamps are not late and the wait starts again. A drained node whose stamps still lag keeps the existing fallback, so a group whose stamps stop one kick short still retires on its pass record, and the watchdog's expiry still retires an executed group without waiting for the node. A node that cannot be read keeps the old bound. Signed-off-by: DjDeveloperr <hey@djdev.me>
…-drain drm/asahi: g17: count the stamp fallback from the drain of the command's node
The first failure reported to a VM is logged once at warning level and says that the client sees a lost device. A client that exits or is killed with work queued also reaches that path: once its file closes, its VM handles drop first, and the work the scheduler has not published yet fails with ENOENT (the VM has no context any more), or with ECANCELED when its queue is destroyed. Nobody is left to see a lost device, yet every such exit leaves a warning in the kernel log. A game that quits with frames in flight does it, and the gpubench stress tests for exit and kill with work in flight (xq.exit, life.churn) fail their kernel-log check on it: one run logged 762 of these lines. Mark the status when the client's VM handle drops, and log ENOENT and ECANCELED of a closed client with the driver's Errors debug class instead. The failure is still recorded as the VM's first error. Whether a VM has warned is now tracked on its own, so the first other failure of a closed client, such as device loss (EIO, ETIMEDOUT, ENODEV) of work it left running, is still logged as a warning after its teardown errors. A client whose VM is still open warns on its first failure, as before. Signed-off-by: DjDeveloperr <hey@djdev.me>
…ding drm/asahi: g17: stop withholding compute doorbells
The J700 board file enables the AVE video encoder and its two DARTs, but
no driver binds apple,t8140-ave and the encoder isn't supported yet. The
DARTs power venc0_sys at probe, which never reaches its requested state
("PS venc0_sys: Failed to reach power state 0xf", repeated at boot), so
the DARTs and the encoder's power domains wait in probe deferral forever
and show up as unclaimed hardware.
Drop the board's enables, so the encoder and its DARTs keep t8140.dtsi's
disabled status, and disable the six venc0 power domains, which nothing
else uses, as the unused dispext0 domains already are.
Signed-off-by: DjDeveloperr <hey@djdev.me>
m1n1 publishes the Apple Device Tree and its own stage 2 log as reserved memory with compatible "phram" (labels "adt" and "m1n1_stage2.log"). Without CONFIG_MTD_PHRAM nothing claims those nodes, and tools that read the ADT or the boot log from /dev/mtd* find nothing. Asahi kernels build it as a module. Tested on J700: with phram.ko both regions bind, /proc/mtd lists m1n1_stage2.log and adt, and the log reads back. Signed-off-by: DjDeveloperr <hey@djdev.me>
…-log drm/asahi: g17: log a closed client's teardown failures at debug level
J700: leave the video encoder disabled; build the phram MTD driver
Brings the boot policy change (PR 545) to aurora-wip, with the fixes merged on integration/aurora since 2dd77ab. aurora-wip had stopped at 2dd77ab, so its SEP driver still refused the record a Stage 1 change makes the enclave rewrite. Conflicts: - arch/arm64/configs/asahi.config: keep aurora-wip's trimmed list and add integration/aurora's STEP_WISE line; the phram MTD lines merged. - tools/aurora-sep packaging: keep both new tools, sep-bio-identities from aurora-wip and aurora-sep-policy-change with the greeter refresh unit from integration/aurora. The Fedora spec moves sep-bio-identities to Source16, since both sides took Source14. The Arch sums are taken from the merged files; integration/aurora's sums for load-driver and XART-SAFETY.md were stale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aurora-wip keeps bindgen's layout assertions in every Rust build, as Documentation/rust/bindgen-layout-checks.rst requires. Stock bindgen 0.71.1 loses the alignment of the empty, cacheline-aligned sched_statistics and of efi_signature_data_t, so the bindings crate stops with E0080 before the SEP module is reached. The rust-build job has failed this way on every branch that carries that rule since 10-28. Prepare the generator from tools/aurora-bindgen/ instead of installing stock bindgen-cli. The top-level Makefile picks up its build/bin/bindgen by itself, so the compile steps stay as they are and the assertions stay on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aurora-wip stopped at integration/aurora 2dd77ab, so it lacks #545, the boot policy change. A kernel built from aurora-wip still refuses the session record the enclave rewrites after a Stage 1 change. That brings back the 10-28 J616s failure: every trusted-key seal fails with EIO, aurora-sep-load waits two minutes, and Touch ID is gone until a manual step. This merges integration/aurora 695d974 into aurora-wip, which brings #545 and everything else merged there since 2dd77ab (59 commits).
Conflicts
Three files conflicted:
arch/arm64/configs/asahi.config: aurora-wip's trimmed list is kept, and integration/aurora's# CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE is not setis added. The phram MTD lines merged cleanly.tools/aurora-sep/packaging/fedora/aurora-sep.spec: both new tools are kept,sep-bio-identities(aurora-wip) andaurora-sep-policy-changewith the greeter refresh unit (integration/aurora). Both sides usedSource14, sosep-bio-identitiesmoves toSource16. The two 1-9 changelog entries become one.tools/aurora-sep/packaging/arch/aurora-sep/PKGBUILD: the union of the sources, with every sum computed from the merged file. integration/aurora's sums forload-driverandXART-SAFETY.mdwere stale after soc: apple: sep: keep Touch ID across a boot policy change #545, so makepkg would have refused them. tools: aurora-sep: share the SELinux device type and let fprintd read the lid (rebased) #584 fixes the same on integration/aurora.MAINTAINERS,drivers/gpu/drm/apple/dcp.candtools/aurora-sep/README.mdmerged without conflicts. The SEP driver files (xart_guard.rs,xart_store.rs,refkey.rs) and the kit'sload-driverandaurora-sep-policy-changeare byte-identical to integration/aurora's, since aurora-wip had not touched them.Testing
xART guard: allowed one rewrite of kind-4 record 1070015f... for a boot policy change, and each time Touch ID kept its enrolment. Normal boots in between rewrote nothing.🤖 Generated with Claude Code