From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Scot Doyle <lkml14@scotdoyle.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
Ashley Lai <ashley@ashleylai.com>,
Marcel Selhorst <tpmdd@selhorst.net>,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Luigi Semenzato <semenzato@google.com>,
tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: fix interrupt timeouts
Date: Mon, 25 Aug 2014 12:03:45 -0600 [thread overview]
Message-ID: <20140825180345.GA1298@obsidianresearch.com> (raw)
In-Reply-To: <alpine.LNX.2.11.1408250710470.1443@localhost.localdomain>
On Mon, Aug 25, 2014 at 07:14:03AM +0000, Scot Doyle wrote:
> commit 4c663cfc523a88d97a8309b04a089c27dc57fd7e
> wait: fix false timeouts when using wait_event_timeout()
>
> changed the semantics of wait_event_interruptible_timeout so that a
> condition check is performed after timeout and 1 is returned if true.
>
> The TPM chip may not send interrupts even though the tpm module is
> attempting to receive interrupts. In this case, after the module
> sends a command to the TPM chip it performs a blocking wait on the
> interrupt queue. No interrupts are sent from the chip, the queue is
> not woken up and the blocking wait times out. Despite timing out,
> the command has completed and the condition check performed by
> wait_event_interruptible_timeout after timeout is true, resulting in
> a return value of 1. Since the expected return value on timeout is 0
> the timeout is not detected.
>
> To fix, assume a return value of 1 or less indicates an elapsed
> timeout. It is possible for the return value to be 1 after receiving
> an interrupt, but this should be rare. The condition is not double-
> checked because of possible side effects.
Hum.. Okay, so I see what you are trying to fix here, but the code is
actually using wait_event_interruptible_timeout correctly as is.
The TPM actually did complete the operation, and the test sentinal
checks directly at the TPM - which makes sense to me..
I think you'll have to directly test in the tis driver if the
interrupt is working.
The ordering in the TIS driver is wrong, interrupts should be turned
on before any TPM commands are issued. This is what other drivers are
doing.
If you fix this, tis can then just count interrupts recieved and check
if that is 0 to detect failure and then turn them off.
Jason
next prev parent reply other threads:[~2014-08-25 18:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 7:14 Scot Doyle
2014-08-25 18:03 ` Jason Gunthorpe [this message]
2014-09-09 19:44 ` Peter Hüwe
2014-09-09 20:03 ` Jason Gunthorpe
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=20140825180345.GA1298@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=ashley@ashleylai.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml14@scotdoyle.com \
--cc=peterhuewe@gmx.de \
--cc=semenzato@google.com \
--cc=stefanb@linux.vnet.ibm.com \
--cc=tpmdd-devel@lists.sourceforge.net \
--cc=tpmdd@selhorst.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome