]> git.baikalelectronics.ru Git - kernel.git/commit
tpm: Replace WARN_ONCE() with dev_err_once() in tpm_tis_status()
authorJarkko Sakkinen <jarkko@kernel.org>
Wed, 9 Jun 2021 13:26:19 +0000 (16:26 +0300)
committerJarkko Sakkinen <jarkko@kernel.org>
Wed, 23 Jun 2021 13:51:04 +0000 (16:51 +0300)
commit819ea124e25fec72477479335ef94e17949ac9fa
tree0ecacbae8564628dec57310243f7da34466770a9
parent0e0bf33a5502a889c262d7ae7ba808ce7bfc78f7
tpm: Replace WARN_ONCE() with dev_err_once() in tpm_tis_status()

Do not tear down the system when getting invalid status from a TPM chip.
This can happen when panic-on-warn is used.

Instead, introduce TPM_TIS_INVALID_STATUS bitflag and use it to trigger
once the error reporting per chip. In addition, print out the value of
TPM_STS for improved forensics.

Link: https://lore.kernel.org/keyrings/YKzlTR1AzUigShtZ@kroah.com/
Fixes: 3f28147b0b0e ("tpm_tis: Add a check for invalid status")
Cc: stable@vger.kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/tpm/tpm_tis_core.c
drivers/char/tpm/tpm_tis_core.h