Bug 202323

Summary: TPM is no longer working: A TPM error (-1) occurred attempting the self test
Product: Drivers Reporter: leozinho29_eu
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.0-rc1, 5.0-rc2 Subsystem:
Regression: No Bisected commit-id:
Attachments: kern.log and config

Description leozinho29_eu 2019-01-17 15:24:33 UTC
Created attachment 280565 [details]
kern.log and config

When using Linux kernel 5.0-rc1 or 5.0-rc2, the TPM on my notebook is no longer working. I noticed it had a problem because on boot the following messages started to appear:

[    0.944600] tpm tpm0: A TPM error (-1) occurred attempting the self test
[    0.949417] tpm tpm0: A TPM error (-1) occurred attempting the self test
[    0.949450] tpm_crb: probe of MSFT0101:00 failed with error -1

The three messages above are new. The following two messages are old and always appear on boot:

[    0.472155] platform MSFT0101:00: failed to claim resource 1: [mem 0xfed40000-0xfed40fff]
[    0.472162] acpi MSFT0101:00: platform device creation failed: -16

Even with that ACPI messages, the TPM chip was still working. A command like:

sudo tpm2_getrandom -V -T device -d /dev/tpm0 1

0x73

Produces random values on 4.20 and older, as expected. On 5.0-rc1 and newer, the output of the same command is:

Failed to initialize device TCTI context: 0xa000a

And /dev/tpm0 does not exist.

kern.log and the config files are attached. Additional data:

Computer model: https://pcsupport.lenovo.com/br/pt/products/laptops-and-netbooks/300-series/310-14isk

Data from Linux 4.20, as 5.0 has /sys/class/tpm/ empty: 

$ cat /sys/class/tpm/tpm0/device/description 
TPM 2.0 Device

$ cat /sys/class/tpm/tpm0/device/hid 
MSFT0101

$ cat /sys/class/tpm/tpm0/device/modalias 
acpi:MSFT0101:

$ cat /sys/class/tpm/tpm0/device/path 
\_SB_.TPM_

$ cat /sys/class/tpm/tpm0/device/status 
15

$ cat /sys/class/tpm/tpm0/device/uevent 
DRIVER=tpm_crb
MODALIAS=acpi:MSFT0101: