HomeFreeBSD

tpm20: fix suspend/resume and entropy harvesting

Description

tpm20: fix suspend/resume and entropy harvesting

There were a few problem here:

  • TPM2_Shutdown results in a response that we need to either process or ignore, otherwise any tpm20_write or tpm20_harvest call will trivially hang on an sc->pending_data_length != 0
  • We should have a matching TPM2_Startup upon resume to restore any state that should have persisted
  • We must drain the harvest task before we suspend to avoid problems there

This commit is sufficient to avoid breaking suspend/resume.

Co-authored-by: markj
Tested by: garga

(cherry picked from commit 38a4995eb52db21116f8b37ed942e66a8c2f050f)

Details

Provenance
kevansAuthored on Feb 5 2026, 3:35 AM
Parents
rG4f4669db7040: OptionalObsoleteFiles: Add etc/zfs/compatibility.d
Branches
Unknown
Tags
Unknown