tpm: read burstcount from TPM_STS in one 32-bit transaction
authorAndrey Pronin <apronin@chromium.org>
Thu, 30 Jun 2016 17:25:43 +0000 (10:25 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:01:27 +0000 (01:01 +0000)
commitffbce80bcb9d378c86e0fe47be6572b2fc1c5baa
tree3bbb4600538278589dcad3609623a6a0b4410367
parent420ffc05b764c1b584591eb38da4004611077b72
tpm: read burstcount from TPM_STS in one 32-bit transaction

commit 9754d45e997000ad4021bc4606cc266bb38d876f upstream.

Some chips incorrectly support partial reads from TPM_STS register
at non-zero offsets. Read the entire 32-bits register instead of
making two 8-bit reads to support such devices and reduce the number
of bus transactions when obtaining the burstcount from TPM_STS.

Fixes: 27084efee0c3 ("tpm: driver for next generation TPM chips")
Signed-off-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
[bwh: Backported to 3.2:
 - Use raw ioread32() instead of tpm_tis_read32()
 - Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/char/tpm/tpm_tis.c