From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com,
linux@mniewoehner.de, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org, l.sanfilippo@kunbus.com,
lukas@wunner.de, p.rosenberger@kunbus.com
Subject: Re: [PATCH v6 5/9] tpm, tpm_tis: Only handle supported interrupts
Date: Wed, 29 Jun 2022 11:20:47 +0200 [thread overview]
Message-ID: <4b2b3a2b-fdc0-a684-d4b1-9725e5b87ccb@gmx.de> (raw)
In-Reply-To: <Yro4tl7g1IqkEszT@kernel.org>
On 28.06.22 01:09, Jarkko Sakkinen wrote:
> On Sun, Jun 26, 2022 at 02:18:17PM +0200, Lino Sanfilippo wrote:
>> On 26.06.22 at 08:40, Jarkko Sakkinen wrote:
>>>
>>> I would instead mask out bits and write a helper function
>>> taking care of this:
>>>
>>> static u8 tpm_tis_filter_sts_mask(u8 int_mask, u8 sts_mask)
>>> {
>>> struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
>>>
>>> if (!(int_mask & TPM_INTF_STS_VALID_INT))
>>> sts_mask &= ~TPM_STS_VALID;
>>>
>>> if (!(int_mask & TPM_INTF_DATA_AVAIL_INT))
>>> sts_mask &= ~TPM_STS_DATA_AVAIL;
>>>
>>> if (!(int_mask & TPM_INTF_CMD_READY_INT))
>>> sts_mask &= ~TPM_STS_COMMAND_READY;
>>>
>>> return sts_mask;
>>> }
>>>
>>> Less operations and imho somewhat cleaner structure.
>>>
>>> Add suggested-by if you want.
>>
>> I thought of a helper like this before but then decided to
>> not introduce another function to keep the code changes minimal. But yes,
>> it is indeed cleaner. I will do the change and resubmit the series.
>>
>> Thanks for the review!
>>
>> Regards,
>> Lino
>
> Yeah, please don't add suggested-by, it's such a minor detail
> in the overall patch :-)
I already created a separate patch which only contains moving the bit checks into the
helper function. For that patch the Suggested-by is fully justified IMHO.
Thanks for taking time to fix these
> glitches and also taking all the feedback into account (and
> also being patient).
>
No problem. Its always good to have some feedback from people that have a deeper insight
into the code. Especially when it is as complex as the TPM subsystem and drivers.
Best regards,
Lino
next prev parent reply other threads:[~2022-06-29 9:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 13:24 [PATCH v6 0/9] TPM IRQ fixes Lino Sanfilippo
2022-06-21 13:24 ` [PATCH v6 1/9] tpm, tpm_tis: Avoid cache incoherency in test for interrupts Lino Sanfilippo
2022-06-26 6:23 ` Jarkko Sakkinen
2022-06-21 13:24 ` [PATCH v6 2/9] tpm, tpm_tis: Claim locality before writing TPM_INT_ENABLE register Lino Sanfilippo
2022-06-21 13:24 ` [PATCH v6 3/9] tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed Lino Sanfilippo
2022-06-21 13:24 ` [PATCH v6 4/9] tpm, tmp_tis: Claim locality before writing interrupt registers Lino Sanfilippo
2022-06-21 13:24 ` [PATCH v6 5/9] tpm, tpm_tis: Only handle supported interrupts Lino Sanfilippo
2022-06-26 6:40 ` Jarkko Sakkinen
2022-06-26 6:44 ` Jarkko Sakkinen
2022-06-26 12:18 ` Lino Sanfilippo
2022-06-27 23:09 ` Jarkko Sakkinen
2022-06-29 9:20 ` Lino Sanfilippo [this message]
2022-06-21 13:24 ` [PATCH v6 6/9] tmp, tmp_tis: Implement usage counter for locality Lino Sanfilippo
2022-06-21 13:24 ` [PATCH v6 7/9] tpm, tpm_tis: Request threaded interrupt handler Lino Sanfilippo
2022-06-21 13:24 ` [PATCH v6 8/9] tpm, tpm_tis: Claim locality in " Lino Sanfilippo
2022-06-21 13:24 ` [PATCH v6 9/9] tpm, tpm_tis: Enable interrupt test Lino Sanfilippo
2022-06-21 22:39 ` Michael Niewöhner
2022-06-22 9:53 ` Lino Sanfilippo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4b2b3a2b-fdc0-a684-d4b1-9725e5b87ccb@gmx.de \
--to=linosanfilippo@gmx.de \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=l.sanfilippo@kunbus.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@mniewoehner.de \
--cc=lukas@wunner.de \
--cc=p.rosenberger@kunbus.com \
--cc=peterhuewe@gmx.de \
--cc=stefanb@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®