mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Marcin Obara <marcin_obara@users.sourceforge.net>
Cc: linux-kernel@vger.kernel.org, Marcel Selhorst <tpm@selhorst.net>,
	Kylene Jo Hall <kjhall@us.ibm.com>,
	tpmdd-devel@lists.sourceforge.net
Subject: [PATCH] 2.6.26-mmotm tpm-correct-tpm-timeouts-to-jiffies-conversion-d820-fix.patch
Date: Sat, 26 Jul 2008 00:03:53 -0400	[thread overview]
Message-ID: <15114.1217045033@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Fri, 25 Jul 2008 18:51:15 PDT." <20080725185115.5d1a107d.akpm@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]

Patch tpm-correct-tpm-timeouts-to-jiffies-conversion reveals a bug in the
Broadcom BCM0102 TPM chipset used in the Dell Latitude D820 - although most of
the timeouts are returned in usecs as per the spec, one is apparently returned
in msecs, which results in a timeout when the code treats it as usecs.  To
prevent a regression, we check for the known too-short value and adjust it to a
value that makes things work.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
cc: Marcin Obara <marcin_obara@users.sourceforge.net>

--- linux-2.6.26-mmotm-0724/drivers/char/tpm/tpm.c.broadcom	2008-07-25 22:13:47.000000000 -0400
+++ linux-2.6.26-mmotm-0724/drivers/char/tpm/tpm.c	2008-07-25 23:30:38.000000000 -0400
@@ -557,6 +557,13 @@ duration:
 	    usecs_to_jiffies(be32_to_cpu
 			     (*((__be32 *) (data +
 					    TPM_GET_CAP_RET_UINT32_1_IDX))));
+	/* The Broadcom BCM0102 chipset in a Dell Latitude D820 gets the above
+	 * value wrong and apparently reports msecs rather than usecs. Test
+	 * for the specific buggy value and adjust it to prevent a regression.
+	 */
+	if (chip->vendor.duration[TPM_SHORT] == 1)
+		chip->vendor.duration[TPM_SHORT] *= 1000;
+
 	chip->vendor.duration[TPM_MEDIUM] =
 	    usecs_to_jiffies(be32_to_cpu
 			     (*((__be32 *) (data +


[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

       reply	other threads:[~2008-07-26  4:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080725164614.044a526e.akpm@linux-foundation.org>
     [not found] ` <50684.1217035060@turing-police.cc.vt.edu>
     [not found]   ` <20080725185115.5d1a107d.akpm@linux-foundation.org>
2008-07-26  4:03     ` Valdis.Kletnieks [this message]
2008-07-26 19:27       ` Marcin Obara
2008-08-11 20:44         ` Andrew Morton
2008-08-15  9:39         ` Valdis.Kletnieks

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=15114.1217045033@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=kjhall@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin_obara@users.sourceforge.net \
    --cc=torvalds@linux-foundation.org \
    --cc=tpm@selhorst.net \
    --cc=tpmdd-devel@lists.sourceforge.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

all inboxes | Powered by JetHome®