Page MenuHomeFreeBSD

tpm_tis: Restore validated interrupts after resume
ClosedPublic

Authored by kbowling on Wed, Aug 26, 11:47 AM.
Tags
None
Referenced Files
F172925994: D59197.diff
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
Unknown Object (File)
Mon, Sep 14, 10:44 PM
Unknown Object (File)
Sun, Sep 13, 7:49 AM
Unknown Object (File)
Sun, Sep 13, 4:25 AM
Unknown Object (File)
Sun, Sep 13, 2:51 AM
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