The TIS interrupt handler can acknowledge and signal an event after the waiter checks the device status but before it enters tsleep(). Since the handler is MPSAFE, the command lock does not close this window. A lost wakeup can delay a completed command for its full timeout, up to 40 seconds for long TPM 2.0 operations. Publish the expected event under an interrupt mutex and use a generation counter to record matching interrupts. Recheck the device predicate without the mutex because register access may sleep on a SPI transport, then compare the generation before atomically waiting on a condition variable. This closes the check-to-sleep race without placing sleeping bus operations under a mutex. Use an absolute deadline while retrying the predicate after wakeups. Apply the same scheme to locality acquisition, which had an equivalent race. Leave the expected event published while polling so the attach-time test can still prove that an advertised interrupt arrived. Regression-tested the polling fallback on two TPM 2.0 FIFO systems with 200 concurrent PCR reads per system and repeated device suspend/resume. Neither ACPI device exposes an IRQ, so the interrupt-mode path remains hardware-unvalidated. MFC after: 2 weeks
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped