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

From: Javier Martinez Canillas
Date: Thu Dec 14 2017 - 07:05:58 EST


Hello Jarkko,

On 12/14/2017 12:21 PM, Jarkko Sakkinen wrote:
> 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@xxxxxxxxx>
> 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@xxxxxxxxx>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
>
> Can you try this?
>

I already suggested the same [0], but James said that made no difference [1].

> /Jarkko
>

[0]: https://lkml.org/lkml/2017/12/12/268
[1]: https://lkml.org/lkml/2017/12/12/1127

Best regards,
--
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat