A TIS locality must remain active while a command is in flight, but should be relinquished once the command completes or is abandoned. The driver retained locality zero after probe, initialization, and resume, and several transaction error paths returned without releasing it. Closing the device after writing a command without reading its response had the same effect. Track locality ownership and whether a command is awaiting its response. Release locality after probe, initialization, and resume; retain it only across a successful command write and its matching response read. Abort and release on errors, replacement commands, close, and detach. Wait for locality during ISA probe instead of assuming an immediate grant, release locality acquired by the probe, and stop treating the command-style TPM_ACCESS register as restorable state. On a ThinkPad T440p with an STMicro TPM 1.2, the old driver left TPM_ACCESS at 0xa1 immediately after attach. The new driver left it at 0x81 after attach, completed PCR reads, and closing with an unread response. PCR reads also survived an unload and reload without TPM or locking diagnostics. MFC after: 2 weeks
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/dev/tpm/tpm.c | ||
|---|---|---|
| 546 | It's really tempting to assert !sc->sc_locality here and the opposite when we relinquish it to enforce some discipline in the driver | |
Comment Actions
Add locality acquire assertion. Release side would be trickier since it is used in abort and cleanup.