During system shutdown, TPM driver should send a Shutdown command to the chip and make sure there're no further commands sent after that (that also ensure that no command is in transition during reset).
In Chrome OS kernels prior to 4.14, it was achieved by a special 'gentle shutdown' patch.
For 4.14, a fix for that is made upstream for TPM 2.0 chips through the newly added mechanism of class shutdown handler for tpm drivers. However, TPM 1.2 chips are still not covered by that. Part of the reason is that there's a potential race condition for tpm sysfs entries: don't hold proper locks for all paths, which can lead to null-deref after the shutdown handler. Upstream TPM 2.0 doesn't have sysfs entries by design, but TPM 1.2 does. See also issue 819265.
Need to fix sysfs and shutdown handling (use the new class shutdown) for TPM 1.2 in 4.14+ kernels.
Comment 1 by benhenry@chromium.org
, Aug 3