lkml.org 
[lkml]   [2022]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tpm: sleep at least <...> ms in tpm_msleep()
Date
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
\
 
 \ /
  Last update: 2022-05-10 13:33    [W:0.110 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site