]> 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)
commit0178f9d0f60ba07e09bab57381a3ef18e2c1fd7f
tree0ecacbae8564628dec57310243f7da34466770a9
parent5a118a39ec9207f9b8cddb013ad270c80bc84a1c
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: 55707d531af6 ("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