[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a4a88b28-0ea0-b285-fe5c-d42944032db2@gmx.de>
Date: Thu, 16 Jun 2022 00:08:20 +0200
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: Jarkko Sakkinen <jarkko@...nel.org>
Cc: peterhuewe@....de, jgg@...pe.ca, stefanb@...ux.vnet.ibm.com,
linux@...ewoehner.de, linux-integrity@...r.kernel.org,
linux-kernel@...r.kernel.org, l.sanfilippo@...bus.com,
lukas@...ner.de, p.rosenberger@...bus.com
Subject: Re: [PATCH v5 06/10] tpm, tpm_tis: Only handle supported interrupts
in wait_for_tpm_stat()
On 15.06.22 at 20:21, Jarkko Sakkinen wrote:
> On Fri, Jun 10, 2022 at 01:08:42PM +0200, LinoSanfilippo@....de wrote:
>> From: Lino Sanfilippo <l.sanfilippo@...bus.com>
>>
>> According to the TPM Interface Specification (TIS) interrupts for
>> "stsValid" and "commandReady" might not be supported.
>>
>> Take this into account and only wait for interrupts which are actually in
>> use in wait_for_tpm_stat(). After that process all the remaining status
>> changes by polling the status register.
>>
>> Signed-off-by: Lino Sanfilippo <l.sanfilippo@...bus.com>
>> ---
>> drivers/char/tpm/tpm_tis_core.c | 46 ++++++++++++++++++++++++---------
>> 1 file changed, 34 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
>> index 2f03fefa1706..028bec44362d 100644
>> --- a/drivers/char/tpm/tpm_tis_core.c
>> +++ b/drivers/char/tpm/tpm_tis_core.c
>> @@ -53,41 +53,63 @@ static int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask,
>> long rc;
>> u8 status;
>> bool canceled = false;
>> + u8 active_irqs = 0;
>
> Something like sts_mask would be a better name. Calling it
> 'active_irqs' is a bit confusing.
Ok.
Regards,
Lino
Powered by blists - more mailing lists