[GH-ISSUE #38] unlock failed - thunderbolt attached 3090 #30

Closed
opened 2026-10-26 16:39:32 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @dagbdagb on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Zagitta/gpu-unlock/issues/38

This is a laptop with a single TB3-connected 3090. Is there some kind of timing sensitive code in gpu_unlock which may need tuning for this type of connection? I note the budget_us=1000 line in the output below. Is this a safe parameter to change in the code?

For testing, I have blacklisted all nvidia modules and evicted both those and gpu_unlock from initramfs to be able to run the module loading by hand for now.

On loading gpu_unlock, I see this:

[   77.142836] gpu_unlock: loading out-of-tree module taints kernel.
[   77.142841] gpu_unlock: module verification failed: signature and/or required key missing - tainting kernel
[   77.619390] pci 0000:09:00.0: enabling device (0000 -> 0002)
[   78.384790] pci 0000:09:00.0: poll timeout: reg=0x110100 last=0x10 mask=0x10 expected=0x0 budget_us=1000
[   78.384808] pci 0000:09:00.0: failure unlock_610.c:735 unlock_transaction_fwsec error=-110 last_mmio=0x110100 value=0x10 valid=1 mapped=1 master=1 firmware_started=1 quiesced=0 pages=20606/20606
[   78.384823] pci 0000:09:00.0: last PCI sample: capability=0 offset=0x4 value=0x6 result=0
[   78.384843] pci 0000:09:00.0: handover refused: incomplete transaction; BME_off=1 command=0x2 config_result=0; BAR ownership and DMA buffers retained until power off
[   78.384856] pci 0000:09:00.0: failure unlock_610.c:278 unlock_transaction_unwind error=-16 last_mmio=0x110100 value=0x10 valid=1 mapped=1 master=0 firmware_started=1 quiesced=0 pages=20606/20606
[   78.384870] pci 0000:09:00.0: last PCI sample: capability=0 offset=0x4 value=0x2 result=0
[   78.384879] pci 0000:09:00.0: firmware did not stop; keeping its DMA buffers until power off
[   78.384887] pci 0000:09:00.0: gpu_unlock: unlock failed (-110)

Would be grateful for suggestions on how to proceed.

Originally created by @dagbdagb on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Zagitta/gpu-unlock/issues/38 This is a laptop with a single TB3-connected 3090. Is there some kind of timing sensitive code in gpu_unlock which may need tuning for this type of connection? I note the `budget_us=1000` line in the output below. Is this a safe parameter to change in the code? For testing, I have blacklisted all nvidia modules and evicted both those and gpu_unlock from initramfs to be able to run the module loading by hand for now. On loading gpu_unlock, I see this: ``` [ 77.142836] gpu_unlock: loading out-of-tree module taints kernel. [ 77.142841] gpu_unlock: module verification failed: signature and/or required key missing - tainting kernel [ 77.619390] pci 0000:09:00.0: enabling device (0000 -> 0002) [ 78.384790] pci 0000:09:00.0: poll timeout: reg=0x110100 last=0x10 mask=0x10 expected=0x0 budget_us=1000 [ 78.384808] pci 0000:09:00.0: failure unlock_610.c:735 unlock_transaction_fwsec error=-110 last_mmio=0x110100 value=0x10 valid=1 mapped=1 master=1 firmware_started=1 quiesced=0 pages=20606/20606 [ 78.384823] pci 0000:09:00.0: last PCI sample: capability=0 offset=0x4 value=0x6 result=0 [ 78.384843] pci 0000:09:00.0: handover refused: incomplete transaction; BME_off=1 command=0x2 config_result=0; BAR ownership and DMA buffers retained until power off [ 78.384856] pci 0000:09:00.0: failure unlock_610.c:278 unlock_transaction_unwind error=-16 last_mmio=0x110100 value=0x10 valid=1 mapped=1 master=0 firmware_started=1 quiesced=0 pages=20606/20606 [ 78.384870] pci 0000:09:00.0: last PCI sample: capability=0 offset=0x4 value=0x2 result=0 [ 78.384879] pci 0000:09:00.0: firmware did not stop; keeping its DMA buffers until power off [ 78.384887] pci 0000:09:00.0: gpu_unlock: unlock failed (-110) ``` Would be grateful for suggestions on how to proceed.
Author
Owner

@odcpw commented on GitHub (Oct 24, 2026):

There is a related state-accounting problem in reviewed revision
4189b17711bd487d9ea4a8ff0055e6d58d19d6d3 that is worth separating from
timeout tuning. This does not establish the cause of the Thunderbolt
failure above: the report does not identify that revision, and its line
numbers/log behavior differ.

unlock_transaction_fwsec() sets work->firmware_started = true before
calling falcon_hs(). But falcon_hs() can still fail during pure validation
or a read-only reset-readiness check, before its first Falcon write, DMA
command or CPU start. The early flag then causes normal unwind to be refused.

I reproduced this offline with the production transaction, pinned firmware,
and the existing synthetic-ROM/MMIO/PCI/DMA shim: start with the cold-success
setup and make the first GSP reset-control read (regs[0x1103c0 / 4]) return
0xbadf0001. The diagnostic output is:

ret=-19 mmio_writes=0 falcon_dma_commands=0 gsp_starts=0 firmware_started=1 retained=1 pins=1 live_dma=20612 regions=1

Thus a failure before any Falcon write still retains the coherent allocation
set, BAR claim, device reference and module pin. PCI setup/BME configuration
has already occurred; "no Falcon write" does not mean the whole transaction
was read-only. This was a simulated failure, not a GPU experiment.

Relevant source:

A bounded improvement would distinguish "no Falcon mutation/exposure yet"
from "Falcon touched / DMA may be live", setting the conservative retention
marker no earlier than the first Falcon write. Normal unwind could then run
for a pure preflight/read failure. PR #35 already addresses a related geometry
preflight case; this read-only reset-control case extends beyond that change.

Do not move the marker only to CPU start: a failed DMA submission can
leave host memory exposed before the CPU starts. Keep retention conservative
after the first Falcon write, DMA submission or launch until quiescence is
proven. Tests should distinguish preflight/read-only failure from first-write,
DMA-timeout and post-launch failures. Increasing or ignoring timeouts would
not fix this accounting problem.

<!-- gh-comment-id:6384628543 --> @odcpw commented on GitHub (Oct 24, 2026): There is a related state-accounting problem in reviewed revision `4189b17711bd487d9ea4a8ff0055e6d58d19d6d3` that is worth separating from timeout tuning. This does **not** establish the cause of the Thunderbolt failure above: the report does not identify that revision, and its line numbers/log behavior differ. `unlock_transaction_fwsec()` sets `work->firmware_started = true` before calling `falcon_hs()`. But `falcon_hs()` can still fail during pure validation or a read-only reset-readiness check, before its first Falcon write, DMA command or CPU start. The early flag then causes normal unwind to be refused. I reproduced this offline with the production transaction, pinned firmware, and the existing synthetic-ROM/MMIO/PCI/DMA shim: start with the cold-success setup and make the first GSP reset-control read (`regs[0x1103c0 / 4]`) return `0xbadf0001`. The diagnostic output is: ```text ret=-19 mmio_writes=0 falcon_dma_commands=0 gsp_starts=0 firmware_started=1 retained=1 pins=1 live_dma=20612 regions=1 ``` Thus a failure before any Falcon write still retains the coherent allocation set, BAR claim, device reference and module pin. PCI setup/BME configuration has already occurred; "no Falcon write" does not mean the whole transaction was read-only. This was a simulated failure, not a GPU experiment. Relevant source: - [early flag assignment](https://github.com/Zagitta/gpu-unlock/blob/4189b17711bd487d9ea4a8ff0055e6d58d19d6d3/kernel/gpu_unlock/unlock_610.c#L992-L996) - [reset read before the first write](https://github.com/Zagitta/gpu-unlock/blob/4189b17711bd487d9ea4a8ff0055e6d58d19d6d3/kernel/gpu_unlock/unlock_610.c#L268-L277) - [retention before ordinary cleanup](https://github.com/Zagitta/gpu-unlock/blob/4189b17711bd487d9ea4a8ff0055e6d58d19d6d3/kernel/gpu_unlock/unlock_610.c#L526-L540) A bounded improvement would distinguish "no Falcon mutation/exposure yet" from "Falcon touched / DMA may be live", setting the conservative retention marker no earlier than the first Falcon write. Normal unwind could then run for a pure preflight/read failure. PR #35 already addresses a related geometry preflight case; this read-only reset-control case extends beyond that change. Do **not** move the marker only to CPU start: a failed DMA submission can leave host memory exposed before the CPU starts. Keep retention conservative after the first Falcon write, DMA submission or launch until quiescence is proven. Tests should distinguish preflight/read-only failure from first-write, DMA-timeout and post-launch failures. Increasing or ignoring timeouts would not fix this accounting problem.
Author
Owner

@dagbdagb commented on GitHub (Oct 24, 2026):

A git pull and rebuild, and proper validation that the installed module is from the recently built tree, and it works.

af28cbbfd3 results in a working unlock for me.

<!-- gh-comment-id:6390881396 --> @dagbdagb commented on GitHub (Oct 24, 2026): A git pull and rebuild, and proper validation that the installed module is from the recently built tree, and it works. af28cbbfd3d922a659227ecfb7369adfd924cf03 results in a working unlock for me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Zagitta/gpu-unlock#30
No description provided.