2021-09-08 13:43:14

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH] tpm/tpm_i2c_infineon: Fix init endian vendor check

On Wed, Sep 08, 2021 at 03:34:16PM +0200, Florian Eckert wrote:
> On my embedded system I use this tpm infineon chip via I2C.
> My system is a MIPS architecture and therefore works in big endian mode.
>
> The problem is that the chip type is not recognised, because the vendor ID
> is incorrectly stored in memory.
>
> By converting the vendor ID with ie32_to_cpus() to the correct format,
> the TPM chip is recognised by the driver and works as expected.
>
> Signed-off-by: Florian Eckert <[email protected]>
> ---
> drivers/char/tpm/tpm_i2c_infineon.c | 2 ++
> 1 file changed, 2 insertions(+)

vendor should be marked as a __le32 and so forth

Jason


2021-09-13 18:00:49

by Florian Eckert

[permalink] [raw]
Subject: Re: [PATCH] tpm/tpm_i2c_infineon: Fix init endian vendor check

>> By converting the vendor ID with ie32_to_cpus() to the correct format,
>> the TPM chip is recognised by the driver and works as expected.
>>
>> Signed-off-by: Florian Eckert <[email protected]>
>> ---
>> drivers/char/tpm/tpm_i2c_infineon.c | 2 ++
>> 1 file changed, 2 insertions(+)
>
> vendor should be marked as a __le32 and so forth

Thanks for your feedback. I will push a v2.

>
> Jason