From: Stefan Mahnke-Hartmann <stefan.mahnke-hartmann@infineon.com>
To: Jarkko Sakkinen <jarkko@kernel.org>, Mimi Zohar <zohar@linux.ibm.com>
Cc: Johannes Holland <johannes.holland@infineon.com>,
Nayna <nayna@linux.vnet.ibm.com>,
<linux-integrity@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<peterhuewe@gmx.de>, <jgg@ziepe.ca>,
<stefan.mahnke-hartmann@infineon.com>
Subject: Re: [PATCH] tpm: sleep at least <...> ms in tpm_msleep()
Date: Mon, 20 Jun 2022 17:58:07 +0200 [thread overview]
Message-ID: <058f32a4-58f4-6748-92cd-ce21b27e02fb@infineon.com> (raw)
In-Reply-To: <YoKPxMLuWWK2al9F@kernel.org>
On 16.05.22 19:54, Jarkko Sakkinen wrote:
> On Thu, May 12, 2022 at 08:21:17AM -0400, Mimi Zohar wrote:
>> On Wed, 2022-05-11 at 18:16 +0300, Jarkko Sakkinen wrote:
>>> On Tue, May 10, 2022 at 01:29:03PM +0200, Johannes Holland wrote:
>>>> To comply with protocol requirements, minimum polling times must often
>>>> be adhered to. Therefore, a macro like tpm_msleep() should sleep at
>>>> least the given amount of time (not up to the given period). Have
>>>> tpm_msleep() sleep at least the given number of milliseconds.
>>>>
>>>> Signed-off-by: Johannes Holland <johannes.holland@infineon.com>
>>>> ---
>>>> drivers/char/tpm/tpm.h | 4 ++--
>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
>>>> index 2163c6ee0d36..0971b55fffe3 100644
>>>> --- a/drivers/char/tpm/tpm.h
>>>> +++ b/drivers/char/tpm/tpm.h
>>>> @@ -185,8 +185,8 @@ int tpm_pm_resume(struct device *dev);
>>>>
>>>> static inline void tpm_msleep(unsigned int delay_msec)
>>>> {
>>>> - usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US,
>>>> - delay_msec * 1000);
>>>> + usleep_range(delay_msec * 1000, (delay_msec * 1000)
>>>> + + TPM_TIMEOUT_RANGE_US);
>>>> };
>>>>
>>>> int tpm_chip_start(struct tpm_chip *chip);
>>>> --
>>>> 2.34.1
>>>>
>>> For this I would really like to hear a 2nd opinion from Nayna and Mimi.
>> This patch reverts commit 5ef924d9e2e8 ("tpm: use tpm_msleep() value as
>> max delay"). Are you experiencing TPM issues that require it?
>>
>> thanks,
>>
>> Mimi
> Yeah, there's no data to support making anything. Without a live
> system having issues with this, I guess this quite definitive NAK.
>
> BR, Jarkko
>
Either way, a static range is not perfect. So I would suggest,to have the
values (TPM_TIMEOUT_RANGE_US, TPM_TIMEOUT_POLL) settable, to give the
possibility to adjust the polling timing vendor specific. Furthermore,
increasing the polling delay as a function of time would limit the number
of attempts, especially for long-running commands.
BR, Stefan
next prev parent reply other threads:[~2022-06-20 15:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 11:29 Johannes Holland
2022-05-11 15:16 ` Jarkko Sakkinen
2022-05-12 12:21 ` Mimi Zohar
2022-05-12 12:32 ` James Bottomley
2022-05-12 16:52 ` Mimi Zohar
2022-05-16 17:57 ` Jarkko Sakkinen
2022-05-18 19:26 ` Nayna
2022-05-18 20:21 ` James Bottomley
2022-05-27 21:37 ` Ken Goldman
2022-05-16 17:54 ` Jarkko Sakkinen
2022-06-20 15:58 ` Stefan Mahnke-Hartmann [this message]
2022-05-11 20:12 ` James Bottomley
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=058f32a4-58f4-6748-92cd-ce21b27e02fb@infineon.com \
--to=stefan.mahnke-hartmann@infineon.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=johannes.holland@infineon.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nayna@linux.vnet.ibm.com \
--cc=peterhuewe@gmx.de \
--cc=zohar@linux.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®