You are not logged in.

#1 2019-05-28 03:19:06

christianbundy
Member
Registered: 2018-05-12
Posts: 19

tpm bug: systemctl suspend turns off computer

All of my packages are up-to-date. In the past two weeks something changed where

systemctl suspend

now turns off my computer completely. Closing the lid has the same effect and I'm unclear on how I should start debugging. Here's the `dmesg -w` output around the time that the suspend is happening:

[   18.331869] rfkill: input handler disabled
[   35.310767] audit: type=1131 audit(1559013073.040:87): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=user@120 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   35.319385] audit: type=1131 audit(1559013073.050:88): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=user-runtime-dir@120 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   48.674747] audit: type=1131 audit(1559013086.723:89): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-localed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   48.724527] audit: type=1131 audit(1559013086.770:90): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   68.612791] audit: type=1131 audit(1559013106.737:91): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=geoclue comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   99.239288] PM: suspend entry (deep)
[   99.239290] PM: Syncing filesystems ... 
[   99.269868] audit: type=1131 audit(1559013137.409:92): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=cjdns comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   99.283004] audit: type=1130 audit(1559013137.422:93): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

What else should I do to debug?

$ uname -a
Linux samus 5.1.4-arch1-1-ARCH #1 SMP PREEMPT Wed May 22 08:06:56 UTC 2019 x86_64 GNU/Linux
$ cat /proc/acpi/wakeup
Device	S-state	  Status   Sysfs node
HDEF	  S3	*disabled
WLAN	  S3	*disabled  pci:0000:01:00.0
EHCI	  S3	*disabled
XHCI	  S3	*enabled   pci:0000:00:14.0
ATPA	  S3	*disabled  i2c:i2c-ATML0000:01
CODC	  S3	*disabled  i2c:i2c-RT5677CE:00
LID0	  S4	*enabled   platform:PNP0C0D:00
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:07dc Intel Corp. 
Bus 001 Device 002: ID 2232:6001 Silicon Motion 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Last edited by christianbundy (2019-11-03 20:57:57)

Offline

#2 2019-05-28 05:42:54

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: tpm bug: systemctl suspend turns off computer

Do you still experience this problem with the LTS kernel?

Offline

#3 2019-05-28 18:25:19

christianbundy
Member
Registered: 2018-05-12
Posts: 19

Re: tpm bug: systemctl suspend turns off computer

Thanks for the suggestions! The LTS kernel seems to resolve the problem, which is a great workaround for the time being. Anything I can / should do to help debug the underlying issue?

Offline

#4 2019-05-28 19:24:02

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: tpm bug: systemctl suspend turns off computer

Try downgrading linux to a 5.0 release and see if the issue is still present.

Offline

#5 2019-05-29 01:53:28

christianbundy
Member
Registered: 2018-05-12
Posts: 19

Re: tpm bug: systemctl suspend turns off computer

I'm on linux-lts 4.19.46-1 now and the problem is no longer present. What further steps can I take to help find the root of the problem?

I can confirm that the problem started between 4.19.46 and 5.1.5, but I'm unclear on what to do now.

Offline

#6 2019-05-29 20:17:45

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 413
Website

Re: tpm bug: systemctl suspend turns off computer

Do you have the latest BIOS updates etc. from your manufacturer? What options, if any, are you passing to the kernel on boot? Anything to do with ACPI? There were a lot of changes to ACPI and Power Management in >= 5.1 IIRC. Are you running any power management tools {TLP,LMT, etc}?

Last edited by CarbonChauvinist (2019-05-29 20:20:50)


"the wind-blown way, wanna win? don't play"

Offline

#7 2019-05-29 22:58:05

christianbundy
Member
Registered: 2018-05-12
Posts: 19

Re: tpm bug: systemctl suspend turns off computer

Just ran the latest BIOS updates and the problem still happens on 5.1. No custom options passed to the kernel on boot and no power management tools unfortunately. FWIW I'm on the Chrombook Pixel 2: https://wiki.archlinux.org/index.php/Chromebook_Pixel_2

Offline

#8 2019-05-30 01:03:02

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 413
Website

Re: tpm bug: systemctl suspend turns off computer

christianbundy wrote:

lol, a bit of a buried lede here I'd say. Yeah, it's going to be a chromebook thing.

Last edited by CarbonChauvinist (2019-05-30 01:04:15)


"the wind-blown way, wanna win? don't play"

Offline

#9 2019-05-30 04:03:23

christianbundy
Member
Registered: 2018-05-12
Posts: 19

Re: tpm bug: systemctl suspend turns off computer

Sorry, I didn't mean to misrepresent anything here. I've had a solid experience for the past ~3 years with this device and the suspend problem just started in the past ~2 weeks with the new Linux update. Is there anything I can do to help debug the problem?

Offline

#10 2019-05-30 18:45:36

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: tpm bug: systemctl suspend turns off computer

This is probably a kernel regression so see https://wiki.archlinux.org/index.php/Bi … s_with_Git

Offline

#11 2019-05-30 19:40:49

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: tpm bug: systemctl suspend turns off computer

Checking if 5.0.Y is affected would remove one bisection step.

Offline

#12 2019-11-03 20:55:45

christianbundy
Member
Registered: 2018-05-12
Posts: 19

Re: tpm bug: systemctl suspend turns off computer

I've finished bisecting the kernel (more info here) and I've identified that the problem comes from this commit:

https://github.com/torvalds/linux/commi … 0507cad874

Also, I've found that before the commit was introduced I saw this in the

journalctl

output:

kernel: tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16)
kernel: tpm tpm0: [Firmware Bug]: TPM interrupt not working, polling instead

After the commit was introduced, this is output instead:

kernel: tpm_tis 00:08: 1.2 TPM (device-id 0xB, rev-id 16)
kernel: tpm tpm0: tpm_try_transmit: send(): error -5
kernel: tpm tpm0: A TPM error (-5) occurred attempting to determine the timeouts
kernel: tpm_tis 00:08: Could not get TPM timeouts and durations

It's clear to me that I have a TPM bug, but I'm not sure how to resolve it. Could anyone point me in the right direction? Thanks!

EDIT: More info, maybe useful?

Current firmware:

seabios-hswbdw_book-mrchromebox_20180912.bin

TPM status:

$ tpm_setenable --status
Tspi_Context_Connect failed: 0x00003011 - layer=tsp, code=0011 (17), Communication failure

I tried to disable the modules by creating a file called

/etc/modprobe.d/tpm.conf

with these contents:

blacklist tpm
blacklist tpm_tis
blacklist tpm_tis_core

This seems to remove the above output from

journalctl

, but

systemctl suspend

continues to shut down the computer. I can confirm that this is happening when

/proc/modules | grep -i tpm

returns nothing, which doesn't make sense to me. How can a module cause a problem if it isn't loaded?

Last edited by christianbundy (2019-11-03 21:31:23)

Offline

#13 2019-11-03 21:19:00

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: tpm bug: systemctl suspend turns off computer

Thank you for performing the bisection

perl scripts/get_maintainer.pl drivers/char/tpm/tpm_tis_core.c
Peter Huewe <peterhuewe@gmx.de> (maintainer:TPM DEVICE DRIVER)
Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> (maintainer:TPM DEVICE DRIVER)
Jason Gunthorpe <jgg@ziepe.ca> (reviewer:TPM DEVICE DRIVER)
Arnd Bergmann <arnd@arndb.de> (supporter:CHAR and MISC DRIVERS)
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:CHAR and MISC DRIVERS)
linux-integrity@vger.kernel.org (open list:TPM DEVICE DRIVER)
linux-kernel@vger.kernel.org (open list)

You could try the linux-integrity mailing list or with a CC to the commit author jarkko.sakkinen@linux.intel.com
or https://bugzilla.kernel.org/ product Drivers component Other

https://www.kernel.org/doc/html/latest/ … -bugs.html provides more information on reporting kernel bugs

Offline

#14 2019-11-03 22:19:56

christianbundy
Member
Registered: 2018-05-12
Posts: 19

Re: tpm bug: systemctl suspend turns off computer

Thank you, I've just opened a bug in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205409

Offline

#15 2019-11-17 21:19:49

satchmosgroove
Member
From: Long Beach, NY
Registered: 2010-01-13
Posts: 88

Re: tpm bug: systemctl suspend turns off computer

Sorry, I didn't find this earlier. I was posting on https://github.com/raphael/linux-samus/issues/220 and in our old Chromebook Pixel 2 thread here: https://bbs.archlinux.org/viewtopic.php?id=194962&p=9

I had the same issue and found another post here: https://bbs.archlinux.org/viewtopic.php?id=176748 So much for efficient forum discussions ;-)

In a nutshell: install acpi and tmp2-tool and add something like

#/etc/modprobe.d/suspend.conf
options tpm_tis force=1 interrupts=0

Offline

Board footer

Powered by FluxBB