All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: "Shaikh, Azhar" <azhar.shaikh@intel.com>, Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	James Ettle <james@ettle.org.uk>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"james.l.morris@oracle.com" <james.l.morris@oracle.com>
Subject: Re: [BISECTED] tpm CLKRUN breaks PS/2 keyboard and touchpad on Braswell system
Date: Tue, 19 Dec 2017 00:06:44 +0100	[thread overview]
Message-ID: <d98db0d0-2615-d13a-e341-749173f3ec1d@redhat.com> (raw)
In-Reply-To: <5FFFAD06ADE1CA4381B3F0F7C6AF5828987F13@ORSMSX109.amr.corp.intel.com>

Hello Azhar,

On 12/18/2017 08:34 PM, Shaikh, Azhar wrote:
> 
> 
>> -----Original Message-----
>> From: Javier Martinez Canillas [mailto:javierm@redhat.com]
>> Sent: Monday, December 18, 2017 11:30 AM
>> To: Jason Gunthorpe <jgg@ziepe.ca>
>> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>; James Ettle
>> <james@ettle.org.uk>; linux-integrity@vger.kernel.org; Shaikh, Azhar
>> <azhar.shaikh@intel.com>; linux-kernel@vger.kernel.org;
>> james.l.morris@oracle.com
>> Subject: Re: [BISECTED] tpm CLKRUN breaks PS/2 keyboard and touchpad on
>> Braswell system
>>
>> Hello Jason,
>>
>> Thanks a lot for your feedback.
>>
>> On 12/18/2017 06:55 PM, Jason Gunthorpe wrote:
>>> On Mon, Dec 18, 2017 at 01:29:01PM +0100, Javier Martinez Canillas wrote:
>>>> On 12/18/2017 01:22 PM, Javier Martinez Canillas wrote:
>>>>
>>>> [snip]
>>>>
>>>>>
>>>>> James,
>>>>>
>>>>> Can you please test the following (untested) patch on top of the
>>>>> other two mentioned patches to see if it makes a difference for you?
>>>>>
>>>>
>>>> I should had tried to at least compile the patch :)
>>>
>>> I think this is backwards..
>>>
>>> If CLKRUN_EN is on (eg power management is NOT enabled on LPC) then
>>> TPM shouldn't do anything at all.
>>>
>>> If CLKRUN_EN is off, then it should try to turn it on/off to save
>>> power.
>>>
>>
>> My knowledge of LPC is near to non-existent so I please forgive me if I'm
>> wrong, but my understanding is that it's the opposite of what you said.
>>
>> When CLKRUN_EN is SET, power management is ENABLED on the LPC bus and
>> the host LCLK clock may be stopped when entering in some low-power states.
>>
>> The CLKRUN# signal is then used by peripherals to restart the LCLK clock after
>> resuming from low-power states to be able to transmit again.
>>
>> When CLKRUN_EN is CLEAR, power management is DISABLED on the LPC bus
>> and the host LCLK clock is never stopped even when entering in some low-
>> power states.
>>
> 
> Hi Javier,
> 
> Yes you are correct with the above understanding of the CLKRUN.
>

Thanks for the confirmation.
 
>> IIUC, if CLKRUN_EN is enabled, then all the devices attached to the LPC bus
>> have to support the CLKRUN protocol. My guess is that on some Braswell
>> systems LPC power management is enabled but the TPM device doesn't have
>> CLKRUN support.
>>
> 
> I think this is what might be happening here.
>

One question, what happens if the CLKRUN protocol is disabled and never enabled
again? My understanding is that the CLKRUN# signal is not required if the host
never stops the LCLK clock, and peripherals that do support the CLKRUN protocol
should still work if the CLKRUN protocol is disabled and the LCLK isn't stopped.

So from what we discussed above, I think it may be correct to completely disable
CLKRUN protocol if there's a peripheral that doesn't support it.
 
> Since I do not have an end product to test this on, I managed to get one BSW Reference Verification Platform(RVP). I flashed the latest Ubuntu (17.10) which is on 4.13.13 kernel version and does have the patch.
> 
> I was able to use the PS/2 mouse and keyboard immediately after bootup and also after suspend/resume cycle. The system does have a TPM.(/dev/tpm0 and /dev/tpmrm0 exist)
>

It's not clear to me if the RVP system is the same one where you found the issue
and lead to the commit that caused the regression.

Could you please test what happens if you disable the CLKRUN_EN and never enable
it again?

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

  parent reply	other threads:[~2017-12-18 23:06 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 19:37 [BISECTED] tpm CLKRUN breaks PS/2 keyboard and touchpad on Braswell system James Ettle
2017-12-12 11:38 ` Javier Martinez Canillas
2017-12-12 18:57   ` Jason Gunthorpe
2017-12-12 19:12     ` Javier Martinez Canillas
2017-12-12 21:17   ` James Ettle
2017-12-14 19:08     ` Javier Martinez Canillas
2017-12-14 19:10       ` Jason Gunthorpe
2017-12-15 14:56         ` Jarkko Sakkinen
2017-12-15 17:38           ` Jason Gunthorpe
2017-12-16 17:01             ` Jarkko Sakkinen
2017-12-16 20:59               ` Javier Martinez Canillas
2017-12-18 11:11                 ` Javier Martinez Canillas
2018-01-02 20:53                   ` Pavel Machek
2018-01-02 20:53                     ` Pavel Machek
2017-12-18 12:22               ` Javier Martinez Canillas
2017-12-18 12:22                 ` Javier Martinez Canillas
2017-12-18 12:29                 ` Javier Martinez Canillas
2017-12-18 12:29                   ` Javier Martinez Canillas
2017-12-18 17:55                   ` Jason Gunthorpe
2017-12-18 19:29                     ` Javier Martinez Canillas
2017-12-18 19:34                       ` Shaikh, Azhar
2017-12-18 20:04                         ` Shaikh, Azhar
2017-12-18 20:19                         ` Jason Gunthorpe
2017-12-18 23:34                           ` Javier Martinez Canillas
2017-12-19  2:08                             ` Jason Gunthorpe
2017-12-19 13:10                             ` Jarkko Sakkinen
2017-12-19 13:12                               ` Javier Martinez Canillas
2017-12-19 13:04                           ` Jarkko Sakkinen
2017-12-19 20:20                             ` Jason Gunthorpe
2017-12-18 23:06                         ` Javier Martinez Canillas [this message]
2017-12-18 20:17                       ` Jason Gunthorpe
2017-12-19 13:02                     ` Jarkko Sakkinen
2017-12-18 18:26                   ` James Ettle
2017-12-18 19:34                     ` Javier Martinez Canillas
2017-12-19 13:00                     ` Jarkko Sakkinen
2017-12-19 13:18                       ` James Ettle
2017-12-22 18:30                         ` Jarkko Sakkinen
2017-12-19 12:59                 ` Jarkko Sakkinen
2017-12-19 13:10                   ` Javier Martinez Canillas
2017-12-19 21:08                 ` [PATCH 1/1] tpm: only attempt to disable the LPC CLKRUN if is already kbuild test robot
2017-12-19 21:08                   ` kbuild test robot
2017-12-14 11:21 ` [BISECTED] tpm CLKRUN breaks PS/2 keyboard and touchpad on Braswell system Jarkko Sakkinen
2017-12-14 12:05   ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d98db0d0-2615-d13a-e341-749173f3ec1d@redhat.com \
    --to=javierm@redhat.com \
    --cc=azhar.shaikh@intel.com \
    --cc=james.l.morris@oracle.com \
    --cc=james@ettle.org.uk \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.