Page MenuHomeFreeBSD

tpm_tis: Restore validated interrupts after resume
ClosedPublic

Authored by kbowling on Aug 26 2026, 11:47 AM.
Tags
None
Referenced Files
F173488933: D59197.id185668.diff
Sat, Sep 26, 7:46 AM
Unknown Object (File)
Thu, Sep 24, 3:36 AM
Unknown Object (File)
Wed, Sep 23, 8:02 AM
Unknown Object (File)
Wed, Sep 23, 8:01 AM
Unknown Object (File)
Tue, Sep 22, 3:43 AM
Unknown Object (File)
Fri, Sep 18, 6:29 PM
Unknown Object (File)
Thu, Sep 17, 12:45 PM
Unknown Object (File)
Tue, Sep 15, 7:13 PM
Subscribers

Details

Summary
TIS interrupt routing and enable registers may lose their state across
S3, while the driver retains its software indication that interrupts
work.  A subsequent locality or command wait can then sleep for an
interrupt that cannot arrive.

Remember whether interrupts worked before suspend and restore the
vector, pending status, and enable mask before TPM2_Startup.  Put the
transport in polling mode first; the interrupt handler promotes it back
to interrupt waits only after observing an interrupt from the restored
configuration.  If register restoration fails, Startup and subsequent
commands continue using polling.

Preserve the initial interrupt-enable mask, including the firmware's
trigger and polarity selection proven by the attach-time interrupt test,
and restore that exact mask rather than accepting post-S3 defaults.

Program the same safe baseline for polling devices during attach and
resume.  Acquire locality, disable global interrupt delivery, and
acknowledge pending status so firmware cannot leave interrupts armed
without a handler.

Use the same register-programming helper during attach and resume, and
stop trying to configure interrupts after a locality acquisition
failure.

Three consecutive device suspend and resume cycles completed on a Lenovo
TPM2 FIFO device without an IRQ resource.  GetRandom succeeded after
each resume, and module detach completed without errors.

MFC after:      2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable