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: [RFC PATCH v3] tpm_tis: verify interrupt during init
Date: Thu, 28 Aug 2014 10:53:48 -0600 [thread overview]
Message-ID: <20140828165348.GE11183@obsidianresearch.com> (raw)
In-Reply-To: <alpine.LNX.2.11.1408280017420.1064@localhost.localdomain>
On Thu, Aug 28, 2014 at 12:35:16AM +0000, Scot Doyle wrote:
> > To move it means we have to understand why you are getting timeouts:
> >
> > [ 33.247720] tpm_tis 00:08: tpm_transmit: tpm_send: error -62
> > [ 33.247731] tpm_tis 00:08: [Hardware Error]: TPM command timed out during continue self test
> >
> > I had thought based on your other patch that these should not happen
> > since the raw register is polled after the timer expires?
>
> It is polled after the timer expires in tpm_tis_send_data, but not in
> tpm_tis_send, and the return value is used in tpm_tis_send...
tpm_tis_send does:
wait_for_tpm_stat
(chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,
tpm_calc_ordinal_duration(chip, ordinal),
&chip->vendor.read_queue, false)
Which is:
rc = wait_event_interruptible_timeout(*queue,
wait_for_tpm_stat_cond(chip, mask, check_cancel,
&canceled),
And we know that wait_event_interruptible_timeout returns 1 if
the condition is true when the timeout expires.
So, all calls to wait_for_tpm_stat should succeed if the register has
the requested bits set at the end of the timer - thus if interrupts
are broken we should never see ETIME from wait_for_tpm_stat as the
chip does actually complete its work. (and this is the correct,
desired, behavior)
Is this analysis wrong somehow?
Lets simplify, instead of wrapping the whole command let us target
only the first part, tpm_tis_send, and let us do that for
get_timeouts.
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -367,6 +367,12 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
rc = -ETIME;
goto out_err;
}
+
+ if (!chip->vendor.int_received) {
+ msleep(1);
+ if (!chip->vendor.int_received)
+ disable_interrupts();
+ }
}
return len;
out_err:
Jason
next prev parent reply other threads:[~2014-08-28 16:54 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 0:58 [PATCH] tpm_tis: Verify ACPI-specified interrupt Scot Doyle
2014-08-22 16:06 ` Jason Gunthorpe
2014-08-22 20:17 ` Scot Doyle
2014-08-22 20:32 ` Jason Gunthorpe
2014-08-22 22:48 ` Peter Hüwe
2014-08-25 6:38 ` Scot Doyle
2014-08-25 18:24 ` Jason Gunthorpe
2014-08-27 4:31 ` [RFC PATCH v2] tpm_tis: verify interrupt during init Scot Doyle
2014-08-27 17:31 ` Jason Gunthorpe
2014-08-27 21:32 ` [RFC PATCH v3] " Scot Doyle
2014-08-27 21:47 ` Jason Gunthorpe
2014-08-28 0:35 ` Scot Doyle
2014-08-28 16:53 ` Jason Gunthorpe [this message]
2014-08-29 23:59 ` [RFC PATCH v4] " Scot Doyle
2014-08-30 17:49 ` Jason Gunthorpe
2014-08-30 23:23 ` [RFC PATCH v5] " Scot Doyle
2014-09-02 17:20 ` Jason Gunthorpe
2014-09-02 20:22 ` [RFC PATCH v6] " Scot Doyle
2014-09-08 22:02 ` Jason Gunthorpe
2014-09-09 2:13 ` [PATCH v7] " Scot Doyle
2014-09-09 3:12 ` Scot Doyle
2014-09-11 0:50 ` [RFC PATCH v8] " Scot Doyle
2014-09-16 23:36 ` Scot Doyle
2014-09-22 17:13 ` Jason Gunthorpe
2014-09-22 19:01 ` Peter Hüwe
2014-10-19 20:08 ` Scot Doyle
2014-09-23 2:44 ` Scot Doyle
2014-09-23 2:51 ` [PATCH v9] " Scot Doyle
2014-09-23 11:55 ` Scot Doyle
2014-09-23 17:12 ` [tpmdd-devel] " Stefan Berger
2014-09-24 19:38 ` Scot Doyle
2014-09-24 19:41 ` Stefan Berger
2014-09-24 22:41 ` [PATCH v10] " Scot Doyle
2014-09-29 17:24 ` Jason Gunthorpe
2014-11-30 14:24 ` Peter Hüwe
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=20140828165348.GE11183@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 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.