Bug 1498987 - [BISECTED REG] tpm CLKRUN breaks PS/2 keyboard and touchpad on Braswell system
Summary: [BISECTED REG] tpm CLKRUN breaks PS/2 keyboard and touchpad on Braswell system
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-05 18:20 UTC by James
Modified: 2018-03-19 22:25 UTC (History)
26 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-19 19:57:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dmesg from 4.13 with broken PS/2 devices (62.50 KB, text/plain)
2017-10-05 18:20 UTC, James
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Linux Kernel 197287 0 None None None 2017-10-16 20:49:43 UTC

Description James 2017-10-05 18:20:24 UTC
Created attachment 1334949 [details]
dmesg from 4.13 with broken PS/2 devices

Description of problem:
With kernel-4.13.4-200.fc26.x86_64 the PS/2 keyboard and mouse on my notebook no longer work (or work briefly, repeat their key like crazy, then stop). In dmesg I see

[   89.522634] psmouse serio2: TouchPad at isa0060/serio2/input0 lost synchronization, throwing 2 bytes away.
[   89.742821] psmouse serio2: resync failed, issuing reconnect request

Worked fine with kernel-4.12.14-300.fc26.x86_64

Version-Release number of selected component (if applicable):
kernel-4.13.4-200.fc26.x86_64

How reproducible:
Always

dmesg attached.

Comment 1 Watanabe, Yuki 2017-10-07 02:29:31 UTC
I have a similar issue with my Fedora 26 installation in VirtualBox on a Windows 10 host.

Everything on the GNOME desktop moves much slower than before. The difference is easily noticable when you open or close a window.
Interaction with the keyboard and mouse is so slow that I find difficulty typing the password in the login screen and dragging windows around the desktop.

My kernel is 4.13.4-200.fc26.x86_64 now. When I go back to 4.12.14-300.fc26.x86_64, it just works fine.

After a quick googling, I found https://bugs.archlinux.org/task/55810 which might be related to this issue.

Comment 2 James 2017-10-13 18:41:19 UTC
Still present in kernel-4.13.5-200.fc26.x86_64

Comment 3 James 2017-10-13 22:40:47 UTC
Still happens with  4.13.5-300.fc27 -- this basically renders F27 unusable on this hardware. Shouldn't this block beta?

What debug info can I provide?

Comment 4 James 2017-10-16 20:30:09 UTC
Still bad with kernel-4.13.6-300.fc27.x86_64. But I've just noticed they keyboard and touchpad work after suspend/resume...

Comment 5 James 2017-11-08 23:04:45 UTC
Still broken with 4.13.11-300.fc27.x86_64. Quite a pause between pressing suspend and actual power down too.

Comment 6 James 2017-11-08 23:06:43 UTC
Caught this in dmesg after resume on 4.13.11-300.fc27.x86_64:


[  540.832159] Suspending console(s) (use no_console_suspend to debug)
[  540.833628] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  540.835799] sd 0:0:0:0: [sda] Stopping disk
[  549.834802] psmouse serio2: Failed to disable mouse on isa0060/serio2
[  551.092850] PM: suspend of devices complete after 10260.088 msecs
[  551.092861] PM: suspend devices took 10.261 seconds
[  551.092867] Component: suspend devices, time: 10261
[  551.092897] ------------[ cut here ]------------
[  551.092924] WARNING: CPU: 0 PID: 1579 at kernel/power/suspend_test.c:55 suspend_test_finish+0x76/0x80
[  551.092927] Modules linked in: ccm xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun nf_conntrack_netbios_ns nf_conntrack_broadcast xt_CT ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c iptable_mangle iptable_raw iptable_security ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep vfat fat arc4 intel_rapl intel_powerclamp snd_hda_codec_hdmi coretemp iwlmvm snd_hda_codec_realtek kvm_intel btusb mac80211 snd_hda_codec_generic btrtl kvm btbcm uvcvideo iTCO_wdt iTCO_vendor_support snd_hda_intel btintel irqbypass videobuf2_vmalloc iwlwifi
[  551.093169]  bluetooth videobuf2_memops snd_hda_codec crct10dif_pclmul crc32_pclmul videobuf2_v4l2 cfg80211 videobuf2_core snd_hda_core ghash_clmulni_intel videodev intel_cstate snd_hwdep ecdh_generic snd_seq tpm_crb rfkill media snd_seq_device snd_pcm joydev rtsx_pci_ms memstick snd_timer wmi int3400_thermal mei_txe snd soundcore tpm_tis mei tpm_tis_core tpm shpchp acpi_thermal_rel processor_thermal_device int340x_thermal_zone intel_soc_dts_iosf lpc_ich i2c_i801 auth_rpcgss sunrpc btrfs xor i915 raid6_pq rtsx_pci_sdmmc mmc_core crc32c_intel i2c_algo_bit drm_kms_helper serio_raw r8169 drm rtsx_pci mii video bfq
[  551.093383] CPU: 0 PID: 1579 Comm: systemd-sleep Not tainted 4.13.11-300.fc27.x86_64 #1
[  551.093389] Hardware name: Novatech W510LU/W510LU, BIOS 5.11 07/05/2016
[  551.093398] task: ffff949e11b10000 task.stack: ffffbc0741a9c000
[  551.093410] RIP: 0010:suspend_test_finish+0x76/0x80
[  551.093416] RSP: 0018:ffffbc0741a9fcd8 EFLAGS: 00010286
[  551.093425] RAX: 0000000000000027 RBX: ffffffffa8c88996 RCX: ffffffffa8e591c8
[  551.093430] RDX: 0000000000000000 RSI: 0000000000000092 RDI: 0000000000000202
[  551.093436] RBP: ffffbc0741a9fce8 R08: 0000000000000027 R09: 000000000002e0e8
[  551.093441] R10: fffffffffff64c60 R11: 0000000000000366 R12: 0000000000002815
[  551.093449] R13: ffff949e09523878 R14: 0000000000000003 R15: ffffffffa93127a0
[  551.093504] FS:  00007fa376dd8940(0000) GS:ffff949e3fc00000(0000) knlGS:0000000000000000
[  551.093510] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  551.093516] CR2: 00007f434b47f91a CR3: 0000000273a1b000 CR4: 00000000001006f0
[  551.093522] Call Trace:
[  551.093548]  suspend_devices_and_enter+0xdb/0x7f0
[  551.093563]  pm_suspend+0x335/0x3a0
[  551.093575]  state_store+0x85/0xf0
[  551.093593]  kobj_attr_store+0xf/0x20
[  551.093606]  sysfs_kf_write+0x37/0x40
[  551.093616]  kernfs_fop_write+0x11c/0x1a0
[  551.093630]  __vfs_write+0x37/0x170
[  551.093646]  ? selinux_file_permission+0xfb/0x120
[  551.093661]  ? security_file_permission+0x3b/0xc0
[  551.093673]  vfs_write+0xb1/0x1a0
[  551.093682]  SyS_write+0x55/0xc0
[  551.093696]  entry_SYSCALL_64_fastpath+0x1a/0xa5
[  551.093706] RIP: 0033:0x7fa376900ea4
[  551.093711] RSP: 002b:00007ffcb654d768 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[  551.093721] RAX: ffffffffffffffda RBX: 00007fa376bd7c20 RCX: 00007fa376900ea4
[  551.093726] RDX: 0000000000000004 RSI: 000055d521be6ed0 RDI: 0000000000000004
[  551.093732] RBP: 00007fa376bd7c78 R08: 000055d521be5390 R09: 00007fa376dd8940
[  551.093737] R10: 000000000000000a R11: 0000000000000246 R12: 0000000000001010
[  551.093742] R13: 0000000000001000 R14: 00007fa376bd7c78 R15: 0000000000000000
[  551.093753] Code: e8 03 00 00 29 c1 e8 9b af 00 00 41 81 fc 10 27 00 00 77 05 5b 41 5c 5d c3 44 89 e2 48 89 de 48 c7 c7 fd 8b c8 a8 e8 7b af 00 00 <0f> ff 5b 41 5c 5d c3 90 90 90 0f 1f 44 00 00 55 0f b6 05 a7 70 
[  551.093942] ---[ end trace 6de4970ece505e87 ]---
[  551.113930] PM: late suspend of devices complete after 19.966 msecs
[  551.139593] PM: noirq suspend of devices complete after 25.644 msecs
[  551.139750] ACPI: Preparing to enter system sleep state S3
[  551.358263] ACPI: EC: event blocked
[  551.358267] ACPI: EC: EC stopped

Comment 7 James 2017-11-09 22:25:46 UTC
still happens in 4.14.0-0.rc8.git1.1.fc28.x86_64

Comment 8 James 2017-11-28 21:34:25 UTC
still broken in kernel-4.13.15-300.fc27.x86_64.

Comment 9 James 2017-11-28 22:01:30 UTC
Tried poking it will all sorts of i8042 options, none worked. i8042.debug had stuff about mux errors/parity errors/timeouts.

Comment 10 James 2017-12-10 18:19:25 UTC
This is caused by TPM. Blacklist the related modules and the keyboard works fine.

Bisect indicates

5e572cab92f0bb56ca1e6e5ee4d807663a7ccbad is the first bad commit
commit 5e572cab92f0bb56ca1e6e5ee4d807663a7ccbad
Author: Azhar Shaikh <azhar.shaikh>
Date:   Sun Jun 18 19:17:59 2017 -0700

    tpm: Enable CLKRUN protocol for Braswell systems
    
    To overcome a hardware limitation on Intel Braswell systems,
    disable CLKRUN protocol during TPM transactions and re-enable
    once the transaction is completed.
    
    Signed-off-by: Azhar Shaikh <azhar.shaikh>
    Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen.com>
    Tested-by: Jarkko Sakkinen <jarkko.sakkinen.com>
    Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen.com>
    Signed-off-by: James Morris <james.l.morris>

:040000 040000 5437c91886cb62c497255f2c60dbedd7268ab50d 1863a1738ded35a817aad52f9f2b451bd43623d7 M	drivers

Comment 11 Laura Abbott 2017-12-11 16:46:59 UTC
Thanks for the bisect and the report. This needs to be reported to the upstream maintainers. I'd recommned e-mailing all the people listed in the tags plus ccing linux-integrity.org and linux-kernel.org

Comment 12 James 2017-12-11 19:25:05 UTC
(In reply to Laura Abbott from comment #11)
> Thanks for the bisect and the report. This needs to be reported to the
> upstream maintainers. I'd recommned e-mailing all the people listed in the
> tags plus ccing linux-integrity.org and
> linux-kernel.org

It's currently on LKBZ, but I'll sent it over to those places too.

Comment 13 Javier Martinez Canillas 2018-01-03 10:00:53 UTC
FYI, a patch was merged on the TPM tree that fixes this issue:

http://git.infradead.org/users/jjs/linux-tpmdd.git/commit/8bb9926265c2caef27a0f49dd8f349df16c79214

Comment 14 Laura Abbott 2018-02-20 19:59:44 UTC
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  As kernel maintainers, we try to keep up with bugzilla but due the rate at which the upstream kernel project moves, bugs may be fixed without any indication to us. Due to this, we are doing a mass bug update across all of the Fedora 27 kernel bugs.
 
Fedora 27 has now been rebased to 4.15.3-300.f27.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you experience different issues, please open a new bug report for those.

Comment 15 James 2018-03-05 19:28:27 UTC
Still present in kernel-4.15.4-300.fc27.x86_64 ... when does that TPM tree patch get upstreamed?

Comment 16 Laura Abbott 2018-03-05 19:33:54 UTC
It's accepted into Linus' tree but it hasn't gotten a backport to stable. 

Javier, is this patch okay to be backported to 4.15?

Comment 17 Laura Abbott 2018-03-05 19:34:41 UTC
(actually adding needinfo)

Comment 18 James 2018-03-05 19:38:27 UTC
(In reply to Laura Abbott from comment #16)
> It's accepted into Linus' tree but it hasn't gotten a backport to stable. 

Ah yes, I now see it the 4.16-rc4. I'll give it a go with the build on Koji.

Comment 19 James 2018-03-05 19:53:57 UTC
OK with kernel-4.16.0-0.rc4.git0.1.fc28 (but only the tpm_crb module is being loaded).

Comment 20 Javier Martinez Canillas 2018-03-05 20:22:47 UTC
(In reply to Laura Abbott from comment #16)
> It's accepted into Linus' tree but it hasn't gotten a backport to stable. 
> 
> Javier, is this patch okay to be backported to 4.15?

Yes, I think is OK to backport for v4.15. I provided a Fixes tag when posting the patch but I see that it doesn't apply cleanly to v4.15 due unrelated changes in the TPM driver.

I guess that's why it wasn't picked automatically for stable.

Comment 21 Javier Martinez Canillas 2018-03-19 17:21:23 UTC
FYI, the patch fixing this issue and its dependencies landed in linux-stable and are included in the 4.15.10 release:

https://lwn.net/Articles/749430/

Comment 22 Laura Abbott 2018-03-19 19:57:31 UTC
Thanks for letting me know. The 4.15.10 update was just pushed so I'm going to close the bug.

Comment 23 James 2018-03-19 22:25:58 UTC
Confirmed working OK with 4.15.10 from updates-testing. Thanks!


Note You need to log in before you can comment on or make changes to this bug.