tpm: fix suspend/resume paths for TPM 2.0
[firefly-linux-kernel-4.4.55.git] / drivers / char / tpm / tpm-interface.c
index bf53a3771da5308ea227094acfe5611569ac59e7..e85d3416d89918e4050eeec8dd32233f2589dc44 100644 (file)
@@ -901,8 +901,10 @@ int tpm_pm_suspend(struct device *dev)
        if (chip == NULL)
                return -ENODEV;
 
-       if (chip->flags & TPM_CHIP_FLAG_TPM2)
-               return tpm2_shutdown(chip, TPM2_SU_CLEAR);
+       if (chip->flags & TPM_CHIP_FLAG_TPM2) {
+               tpm2_shutdown(chip, TPM2_SU_STATE);
+               return 0;
+       }
 
        /* for buggy tpm, flush pcrs with extend to selected dummy */
        if (tpm_suspend_pcr) {