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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:53 +0000 (16:56 +0200)
commit97cbddc8a2bc62fe27fd3ca7be52abf3c675a4a6
tree4bdd6e066377476a0f5b0892a3131df6469805b7
parentb5a2b5b64237b9d1bdb002ff96b5f3b8e142b2b2
tpm: Replace WARN_ONCE() with dev_err_once() in tpm_tis_status()

commit 0178f9d0f60ba07e09bab57381a3ef18e2c1fd7f upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/tpm/tpm_tis_core.c
drivers/char/tpm/tpm_tis_core.h