From: Olof Johansson <olof@lixom.net>
To: linux-kernel@vger.kernel.org
Cc: Debora Velarde <debora@linux.vnet.ibm.com>,
Rajiv Andrade <srajiv@linux.vnet.ibm.com>,
Marcel Selhorst <m.selhorst@sirrix.com>,
tpmdd-devel@lists.sourceforge.net,
James Morris <jmorris@namei.org>, Olof Johansson <olof@lixom.net>,
Matthew Garrett <mjg@redhat.com>
Subject: [PATCH] tpm: fix panic caused by "tpm: Autodetect itpm devices"
Date: Thu, 6 Jan 2011 21:24:01 -0600 [thread overview]
Message-ID: <1294370641-6791-1-git-send-email-olof@lixom.net> (raw)
commit 3f0d3d016d89a5efb8b926d4707eb21fa13f3d27 adds a check for
PNP device id to the common tpm_tis_init() function, which in some
cases (force=1) will be called without the device being a member of
a pnp_dev. Oopsing and panics ensue.
Move the test up to before the call to tpm_tis_init(), since it
just modifies a global variable anyway.
Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: stable@kernel.org [2.6.37+]
---
drivers/char/tpm/tpm_tis.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index c17a305..dd21df5 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -493,9 +493,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
"1.2 TPM (device-id 0x%X, rev-id %d)\n",
vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
- if (is_itpm(to_pnp_dev(dev)))
- itpm = 1;
-
if (itpm)
dev_info(dev, "Intel iTPM workaround enabled\n");
@@ -637,6 +634,9 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
else
interrupts = 0;
+ if (is_itpm(pnp_dev))
+ itpm = 1;
+
return tpm_tis_init(&pnp_dev->dev, start, len, irq);
}
--
1.7.3.GIT
next reply other threads:[~2011-01-07 3:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 3:24 Olof Johansson [this message]
2011-01-20 17:37 ` Olof Johansson
2011-01-20 18:44 ` Rajiv Andrade
2011-01-20 23:11 ` James Morris
2011-01-26 14:59 ` Rajiv Andrade
2011-01-24 0:31 ` James Morris
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=1294370641-6791-1-git-send-email-olof@lixom.net \
--to=olof@lixom.net \
--cc=debora@linux.vnet.ibm.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.selhorst@sirrix.com \
--cc=mjg@redhat.com \
--cc=srajiv@linux.vnet.ibm.com \
--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®