summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko@kernel.org>2023-04-26 20:29:28 +0300
committerJarkko Sakkinen <jarkko@kernel.org>2023-05-16 02:43:12 +0300
commit99d46450625590d410f86fe4660a5eff7d3b8343 (patch)
tree446c3d6a59c7a4a8762954ee3e527ff0b257d686 /include
parent1398aa803f198b7a386fdd8404666043e95f4c16 (diff)
tpm: Prevent hwrng from activating during resume
Set TPM_CHIP_FLAG_SUSPENDED in tpm_pm_suspend() and reset in tpm_pm_resume(). While the flag is set, tpm_hwrng() gives back zero bytes. This prevents hwrng from racing during resume. Cc: stable@vger.kernel.org Fixes: 6e592a065d51 ("tpm: Move Linux RNG connection to hwrng") Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/tpm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index 77693389c3f9..6a1e8f157255 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -282,6 +282,7 @@ enum tpm_chip_flags {
TPM_CHIP_FLAG_ALWAYS_POWERED = BIT(5),
TPM_CHIP_FLAG_FIRMWARE_POWER_MANAGED = BIT(6),
TPM_CHIP_FLAG_FIRMWARE_UPGRADE = BIT(7),
+ TPM_CHIP_FLAG_SUSPENDED = BIT(8),
};
#define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)