diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-29 17:38:06 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-29 17:38:06 -0500 |
| commit | 8f1b1a509658bee2397ddb9937cbfa1b71cdca17 (patch) | |
| tree | 502902dcef6b90920aecf525ec5da67918d21fa9 | |
| parent | a01af8e4a4ee1135598f157051959982418c38f8 (diff) | |
| parent | 3f0d3d016d89a5efb8b926d4707eb21fa13f3d27 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
| -rw-r--r-- | drivers/char/tpm/tpm_tis.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 1030f842013..c17a305ecb2 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
| 26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
| 27 | #include <linux/wait.h> | 27 | #include <linux/wait.h> |
| 28 | #include <linux/acpi.h> | ||
| 28 | #include "tpm.h" | 29 | #include "tpm.h" |
| 29 | 30 | ||
| 30 | #define TPM_HEADER_SIZE 10 | 31 | #define TPM_HEADER_SIZE 10 |
| @@ -78,6 +79,26 @@ enum tis_defaults { | |||
| 78 | static LIST_HEAD(tis_chips); | 79 | static LIST_HEAD(tis_chips); |
| 79 | static DEFINE_SPINLOCK(tis_lock); | 80 | static DEFINE_SPINLOCK(tis_lock); |
| 80 | 81 | ||
| 82 | #ifdef CONFIG_ACPI | ||
| 83 | static int is_itpm(struct pnp_dev *dev) | ||
| 84 | { | ||
| 85 | struct acpi_device *acpi = pnp_acpi_device(dev); | ||
| 86 | struct acpi_hardware_id *id; | ||
| 87 | |||
| 88 | list_for_each_entry(id, &acpi->pnp.ids, list) { | ||
| 89 | if (!strcmp("INTC0102", id->id)) | ||
| 90 | return 1; | ||
| 91 | } | ||
| 92 | |||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | #else | ||
| 96 | static int is_itpm(struct pnp_dev *dev) | ||
| 97 | { | ||
| 98 | return 0; | ||
| 99 | } | ||
| 100 | #endif | ||
| 101 | |||
| 81 | static int check_locality(struct tpm_chip *chip, int l) | 102 | static int check_locality(struct tpm_chip *chip, int l) |
| 82 | { | 103 | { |
| 83 | if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) & | 104 | if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) & |
| @@ -472,6 +493,9 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, | |||
| 472 | "1.2 TPM (device-id 0x%X, rev-id %d)\n", | 493 | "1.2 TPM (device-id 0x%X, rev-id %d)\n", |
| 473 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); | 494 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); |
| 474 | 495 | ||
| 496 | if (is_itpm(to_pnp_dev(dev))) | ||
| 497 | itpm = 1; | ||
| 498 | |||
| 475 | if (itpm) | 499 | if (itpm) |
| 476 | dev_info(dev, "Intel iTPM workaround enabled\n"); | 500 | dev_info(dev, "Intel iTPM workaround enabled\n"); |
| 477 | 501 | ||
