]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:40 +0000 (09:31 +0200)
commite333e5b65cd5e47d812548cea5edb8c124552d02
treef753a26107147de04296ec8f9c51f57744cc75bf
parentaa4ec123c1247af59814ef95f2a53823deb67c54
tpm: Replace WARN_ONCE() with dev_err_once() in tpm_tis_status()

BugLink: https://bugs.launchpad.net/bugs/1938340
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/char/tpm/tpm_tis_core.c
drivers/char/tpm/tpm_tis_core.h