blob: 2a74d008df89613c64f585135a108215817c5b64 [file] [log] [blame]
From b410a628fe6b130f79fcb045b8bb567c10c124cd Mon Sep 17 00:00:00 2001
From: Andrey Pronin <apronin@chromium.org>
Date: Wed, 13 Jul 2016 13:05:00 -0700
Subject: [PATCH] FROMLIST: tpm_tis_spi: add max xfer size
Reject burstcounts larger than 64 bytes reported by tpm.
SPI Hardware Protocol defined in section 6.4 of TCG PTP
Spec supports up to 64 bytes of data in a transaction.
BUG=chrome-os-partner:52019
TEST=Boot on kevin, verify that trunksd and tpmc work
(am from https://patchwork.kernel.org/patch/9250647/)
Change-Id: I342732e676e78976d1439dba9b58551217161d24
Signed-off-by: Andrey Pronin <apronin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/362178
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
---
drivers/char/tpm/tpm_tis_spi_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
index a0963a3e92bdd86da6627412eeff1e0b8a00aa6a..8ae435cbf05146c4c5ed819c3d66ac0988d4eecb 100644
--- a/drivers/char/tpm/tpm_tis_spi_main.c
+++ b/drivers/char/tpm/tpm_tis_spi_main.c
@@ -167,6 +167,7 @@ int tpm_tis_spi_init(struct spi_device *spi, struct tpm_tis_spi_phy *phy,
static const struct tpm_tis_phy_ops tpm_spi_phy_ops = {
.read_bytes = tpm_tis_spi_read_bytes,
.write_bytes = tpm_tis_spi_write_bytes,
+ .max_xfer_size = MAX_SPI_FRAMESIZE,
};
static int tpm_tis_spi_probe(struct spi_device *dev)
--
2.38.1.584.g0f3c55d4c2-goog