Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbdLLLiG (ORCPT ); Tue, 12 Dec 2017 06:38:06 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:45463 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbdLLLiD (ORCPT ); Tue, 12 Dec 2017 06:38:03 -0500 X-Google-Smtp-Source: ACJfBovC5meoMj/2pBv7jez3Yk4QC3oQSf+IEOCVGJddyH6gGRXcnirn5bFswnO4nq2FAw2aXv600Q== Subject: Re: [BISECTED] tpm CLKRUN breaks PS/2 keyboard and touchpad on Braswell system To: James Ettle , linux-integrity@vger.kernel.org, azhar.shaikh@intel.com, jarkko.sakkinen@linux.intel.com Cc: linux-kernel@vger.kernel.org, james.l.morris@oracle.com, Jason Gunthorpe References: <57d96314-cc9c-0656-186e-4eb77a132b70@ettle.org.uk> From: Javier Martinez Canillas Message-ID: <34b361bf-cce7-a1ac-f8a3-76ef22f5b6b0@redhat.com> Date: Tue, 12 Dec 2017 12:38:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <57d96314-cc9c-0656-186e-4eb77a132b70@ettle.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2882 Lines: 67 Hello James, On 12/11/2017 08:37 PM, James Ettle wrote: > Hello, > > [First: Apologies if cross-posting from Kernel.org BZ is bad form; my distro BZ advised I post this to your mailing list as well.] > > Situation: enabling TPM on a Clevo W510LU with an Intel N3160 CPU breaks PS/2 keyboard and mouse. They just don't respond until after a suspend/resume cycle, and after that they later stop after a while. > > I have confirmed this by blacklisting tpm modules. I noticed this first with kernel 4.13, and have bisected it down to: > > 5e572cab92f0bb56ca1e6e5ee4d807663a7ccbad is the first bad commit > commit 5e572cab92f0bb56ca1e6e5ee4d807663a7ccbad > Author: 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 > Reviewed-by: Jarkko Sakkinen > Tested-by: Jarkko Sakkinen > Signed-off-by: Jarkko Sakkinen > Signed-off-by: James Morris > > :040000 040000 5437c91886cb62c497255f2c60dbedd7268ab50d 1863a1738ded35a817aad52f9f2b451bd43623d7 M drivers > > Currently in Kernel.org bugzilla 197287. > > Please let me know if you need any further info. > I don't have access to a Braswell machine to reproduce this. I tried to do it on different Intel systems by modifying is_bsw() to always return true, but that didn't work either. They work correctly even when CLKRUN_EN is toggled. I'm not familiar with LPC so please let me know if my assumptions are wrong, but I find suspicious that a driver for a single device attached to the bus can control the CLKRUN# signal which AFAIU may be needed for other devices. So that would explain why the mentioned commit causes issues for PS/2 mouse and keyboards, since these are attached to the LPC bus and may rely on the CLKRUN# signal for proper operation. I see that the following [0,1] patches for the tpm_tis driver landed a few days ago, they change how the CLKRUN protocol is enabled/disabled. Instead of doing it per each TPM transaction, it does it once for the duration of a TPM command. Not sure if that will make things better or worse for you, but it would be good to try in case it makes a difference. [0]: http://git.infradead.org/users/jjs/linux-tpmdd.git/commit/667dcc75be864ff4c17cf58891853b7393bba3e2 [1]: http://git.infradead.org/users/jjs/linux-tpmdd.git/commit/db3248e8a036c39141c8f7e9f1cf5c5ae6815f76 > Many thanks, > James. > Best regards, -- Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat