public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] tpm/tpm_i2c_infineon: Fix init endian vendor check
@ 2021-09-13 12:05 Florian Eckert
  2021-09-13 13:02 ` Jason Gunthorpe
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Florian Eckert @ 2021-09-13 12:05 UTC (permalink / raw)
  To: peterhuewe, jarkko, jgg, Eckert.Florian; +Cc: linux-integrity, linux-kernel

On my embedded system I use this tpm infineon chip via i2c bus.
The system is a MIPS architecture and therefore works in big endian mode.

The problem is, that the chip type is not correctly recognized,
because the vendor ID is wrongly aligned in the memory.

By declaring the vendor ID variable as a `__le32` type, the TPM chip is
then correctly recognized by the driver and feels then responsible.

The device works than as expected.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
---
v2:
* use variable type instead of le32_to_cpus function call
 drivers/char/tpm/tpm_i2c_infineon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
index a19d32cb4e94..30c320ea57fd 100644
--- a/drivers/char/tpm/tpm_i2c_infineon.c
+++ b/drivers/char/tpm/tpm_i2c_infineon.c
@@ -611,7 +611,7 @@ static const struct tpm_class_ops tpm_tis_i2c = {
 
 static int tpm_tis_i2c_init(struct device *dev)
 {
-	u32 vendor;
+	__le32 vendor;
 	int rc = 0;
 	struct tpm_chip *chip;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-13 20:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-13 12:05 [PATCH v2 1/1] tpm/tpm_i2c_infineon: Fix init endian vendor check Florian Eckert
2021-09-13 13:02 ` Jason Gunthorpe
2021-09-13 13:46   ` Florian Eckert
2021-09-13 14:03     ` Jason Gunthorpe
2021-09-13 18:31 ` kernel test robot
2021-09-13 20:31 ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox