Commit 05a462af authored by Marcel Selhorst's avatar Marcel Selhorst Committed by Linus Torvalds

TPM: fix TIS device driver locality request

During the initialization of the TPM TIS driver, the necessary locality has
to be requested earlier in the init-process.  Depending on the used TPM
chip, this leads to wrong information.  For example: Lenovo X61s with Atmel
TPM:

tpm_tis 00:0a: 1.2 TPM (device-id 0xFFFF, rev-id 255)

But correct is:

tpm_tis 00:0c: 1.2 TPM (device-id 0x3203, rev-id 9)

This short patch fixes this issue.
Signed-off-by: default avatarMarcel Selhorst <tpm@selhorst.net>
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 19fd4bb2
...@@ -450,6 +450,11 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, ...@@ -450,6 +450,11 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
goto out_err; goto out_err;
} }
if (request_locality(chip, 0) != 0) {
rc = -ENODEV;
goto out_err;
}
vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
/* Default timeouts */ /* Default timeouts */
...@@ -487,11 +492,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, ...@@ -487,11 +492,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
if (intfcaps & TPM_INTF_DATA_AVAIL_INT) if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
dev_dbg(dev, "\tData Avail Int Support\n"); dev_dbg(dev, "\tData Avail Int Support\n");
if (request_locality(chip, 0) != 0) {
rc = -ENODEV;
goto out_err;
}
/* INTERRUPT Setup */ /* INTERRUPT Setup */
init_waitqueue_head(&chip->vendor.read_queue); init_waitqueue_head(&chip->vendor.read_queue);
init_waitqueue_head(&chip->vendor.int_queue); init_waitqueue_head(&chip->vendor.int_queue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment