Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  tpm: Autodetect itpm devices
  • Loading branch information
Linus Torvalds committed Nov 29, 2010
2 parents a01af8e + 3f0d3d0 commit 8f1b1a5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/wait.h>
#include <linux/acpi.h>
#include "tpm.h"

#define TPM_HEADER_SIZE 10
Expand Down Expand Up @@ -78,6 +79,26 @@ enum tis_defaults {
static LIST_HEAD(tis_chips);
static DEFINE_SPINLOCK(tis_lock);

#ifdef CONFIG_ACPI
static int is_itpm(struct pnp_dev *dev)
{
struct acpi_device *acpi = pnp_acpi_device(dev);
struct acpi_hardware_id *id;

list_for_each_entry(id, &acpi->pnp.ids, list) {
if (!strcmp("INTC0102", id->id))
return 1;
}

return 0;
}
#else
static int is_itpm(struct pnp_dev *dev)
{
return 0;
}
#endif

static int check_locality(struct tpm_chip *chip, int l)
{
if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
Expand Down Expand Up @@ -472,6 +493,9 @@ 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");

Expand Down

0 comments on commit 8f1b1a5

Please sign in to comment.