Repository navigation
drm/asahi: g15: decline probes before activation with -ENODEV - #470
Conversation
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Scott Jones <[email protected]>
maralcbr
left a comment
There was a problem hiding this comment.
Thanks @scottjones, this is the right fix, and it's small. I found no blockers.
Checked and fine
- The driver core only adds a device to the deferred list on
-EPROBE_DEFER(drivers/base/dd.c:899-900), and a later non-deferral failure never takes it off. The entry only goes when the device binds (dd.c:465), when the deferred work picks it up (dd.c:103), or when the device is removed. So the old gate (mod.rs:205-206) could leave the GPU listed after a terminal failure in activation's probe, as the commit says. - Nothing before activation needed that list.
activate()publishesMODULE_READYand then runsdriver_attachonasahi-g15(mod.rs:239-246,glue.c:336-349). A probe racing the store is serialised by the device lock in__driver_attach(dd.c:1232-1279). A device added later sees the flag set. - The display and PMP waits still defer (
boot.rs:493-516).-ENODEVfrom probe is logged atdev_dbgonly (dd.c:637-640), so nothing new shows indmesgat default levels. - The harness ties the new mutant to the production gate line (
g15-probe-init-tests.py:388-391). The existing readiness-gate mutant still fails on its own assertion (:157-158). CI'shost tests (tools)job runs this suite with--mutations, and it passed.ci / packagewas still pending when I looked.
Behaviour changes to note in the PR body
- The readiness gate no longer puts the GPU in
devices_deferred. The supplier-link check inreally_probe(dd.c:668-670) can still defer it before the probe runs, so "never listed before activation" would overstate it. - A G15 probe failure that isn't a deferral is no longer retried by later deferred-probe triggers. Writing the device name to
/sys/bus/platform/drivers_probestill retries it. Whether to accept losing the automatic retry is Marcelo's call. - Suggest: "The readiness gate no longer defers, so it doesn't put the GPU in
devices_deferred. A non-deferral G15 probe failure is no longer retried by later deferred-probe triggers; writing the device name to/sys/bus/platform/drivers_probestill retries it."
Smaller things
- Could you link the 7.3 port (PR or issue) from the body once it exists, so the fix doesn't land on only one branch?
- Two nits inline, fine as follow-ups.
omacom/omarchy-mac-pkgs#135 looks like it covers the userspace side of the J514C wait. The two complement each other.
For release (not the source merge): this changes the GPU probe path on M3 Macs, so it still needs cold-boot evidence on hardware:
- On a J514C with the rejected firmware, the GPU should drop out of
devices_deferredafter the failure, and the display wait should move on. - On a working T6030 (J514S or J516S) and a T6031, the GPU should still come up, including when the display or PMP is late.
Also:
drivers/gpu/drm/asahi/g15/mod.rs:234: nit: the gate no longer defers, so "A deferred probe racing the final activation" reads stale. Suggest: "A probe racing the final activation (asynchronous, or a deferred-probe retry) sees the Release/Acquire publication."
Reviewed at 6447458068e3.
— Marcelo's agent
| try_pin_init!(Driver { | ||
| _driver: { | ||
| // Not EPROBE_DEFER: a deferred device stays listed in devices_deferred until the | ||
| // deferred-probe work runs, even after activate()'s probe fails for good. Activation |
There was a problem hiding this comment.
nit: by my count this line is one column over 100. Rewrapping the comment would avoid a checkpatch warning.
— Marcelo's agent
maralcbr
left a comment
There was a problem hiding this comment.
Approving. Right fix: the driver core only lists a device on -EPROBE_DEFER, activate() reprobes every unbound device via driver_attach, and the display/PMP waits in the real probe still defer.
Losing the automatic retry of a terminal G15 failure is fine by me: a retry would hit the same failure, and after firmware start the device stays bound with None anyway. Note this only removes gate-generated deferrals; supplier-link deferrals can still list the GPU.
Non-blocking:
mod.rs:234: "A deferred probe racing the final activation" is stale now; "A probe racing…" reads right.- Please link the 7.3 port from the body once it exists.
Release still needs cold-boot evidence on a J514C (GPU leaves devices_deferred, display wait moves on) and a working T6030/T6031.
Reviewed at 6447458068e3.
f5180d8
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, omacom#470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.]
…n runs Builds 7.3.0.aurora0test3 from scottjones/aurora-linux test/aurora-7.3 (c4f7f5f0833): aurora-silicon's integration/aurora at 5d112b1d549 plus the linux-aurora series, the merged omacom/linux-aurora#470, and a revert of the base's spi-apple FIFO rewrite. Draft test pin only, for CI packages. Co-authored-by: Claude Fable 5.2 <[email protected]>
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, omacom/linux-aurora#470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.]
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, #470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.] (cherry picked from commit 147001c)
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, omacom/linux-aurora#470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.]
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, #470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.] (cherry picked from commit 147001c)
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, omacom/linux-aurora#470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.]
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, omacom/linux-aurora#470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.] Signed-off-by: Ryan Murray <[email protected]>
Before activation, asahi-g15's probe returned -EPROBE_DEFER. When the real probe later failed for good (the J514C's rejected firmware, for example), the GPU stayed in
devices_deferreduntil the deferred-probe work next ran, so omarchy-mac's display wait kept waiting. The probe now returns -ENODEV before activation: activate() already reprobes every unbound device, and the display and PMP waits inside the real probe still defer.g15-probe-init-tests.pynow checks that pre-activation probes return -ENODEV (it fails on the old code with -517 vs -19) and adds a mutant that defers again.Refs omacom/omarchy-mac-pkgs#129 and omacom/omarchy-mac-pkgs#135.
The 7.3 branch needs the same one-line change; porting the test there is pending.
🤖 Generated with Claude Code