tpm: Enable hwrng only for Pluton on AMD CPUs
authorJarkko Sakkinen <jarkko@kernel.org>
Mon, 4 Sep 2023 18:12:10 +0000 (21:12 +0300)
committerJarkko Sakkinen <jarkko@kernel.org>
Mon, 4 Sep 2023 18:57:59 +0000 (21:57 +0300)
commit8f7f35e5aa6f2182eabcfa3abef4d898a48e9aa8
treeab4f585a34fb5a6b73f2b43e770735814dd399f6
parent9c377852ddfdc557b1370f196b0cfdf28d233460
tpm: Enable hwrng only for Pluton on AMD CPUs

The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
all AMD fTPMs") doesn't work properly on a number of Intel fTPMs.  On the
reported systems the TPM doesn't reply at bootup and returns back the
command code. This makes the TPM fail probe on Lenovo Legion Y540 laptop.

Since only Microsoft Pluton is the only known combination of AMD CPU and
fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin
aware of this, print also info message to the klog.

Cc: stable@vger.kernel.org
Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs")
Reported-by: Todd Brandt <todd.e.brandt@intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804
Reported-by: Patrick Steinhardt <ps@pks.im>
Reported-by: Raymond Jay Golo <rjgolo@gmail.com>
Reported-by: Ronan Pigott <ronan@rjp.ie>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm_crb.c