Re: [BISECTED] tpm CLKRUN breaks PS/2 keyboard and touchpad on Braswell system

Jarkko Sakkinen
2017-12-14T11:21:30Z

On Mon, Dec 11, 2017 at 07:37:29PM +0000, 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:

In my GIT tree there is now:

commit db3248e8a036c39141c8f7e9f1cf5c5ae6815f76 (HEAD -> next, origin/next, origin/master, master)
Author: Azhar Shaikh <azhar.shaikh@intel.com>
Date: Wed Dec 6 17:38:10 2017 -0800

tpm: Keep CLKRUN enabled throughout the duration of transmit_cmd()

Commit 5e572cab92f0bb5 ("tpm: Enable CLKRUN protocol for Braswell
systems") disabled CLKRUN protocol during TPM transactions and re-enabled
once the transaction is completed. But there were still some corner cases
observed where, reading of TPM header failed for savestate command
while going to suspend, which resulted in suspend failure.
To fix this issue keep the CLKRUN protocol disabled for the entire
duration of a single TPM command and not disabling and re-enabling
again for every TPM transaction. For the other TPM accesses outside
TPM command flow, add a higher level of disabling and re-enabling
the CLKRUN protocol, instead of doing for every TPM transaction.

Fixes: 5e572cab92f0bb5 ("tpm: Enable CLKRUN protocol for Braswell systems")

Signed-off-by: Azhar Shaikh <azhar.shaikh@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Can you try this?

/Jarkko