Skip to contentSkip to conversation

powerpc/pseries: fix max polling time in plpks_confirm_object_flushed() function

PATCH Superseded Nayna Jain 2 participants 2 messages Mar 14, 2024 – Mar 15, 2024 PowerPC

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Nayna Jain

author
#0 lore raw

PATCH v2 1/1 powerpc/pseries: fix max polling time in plpks_confirm_object_flushed() function

usleep_range() function takes input time and range in usec. However, currently it is assumed in msec in the function plpks_confirm_object_flushed().

Fix the total polling time for the object flushing from 5msec to 5sec.

Fixes 2454a7af0f2a ("powerpc/pseries: define driver for Platform KeyStore")

---
v2:
* Updated based on feedback from Michael Ellerman Replaced usleep_range with fsleep.
Since there is no more need to specify range, sleep time is
reverted back to 10 msec.

 arch/powerpc/include/asm/plpks.h       | 5 ++---
 arch/powerpc/platforms/pseries/plpks.c | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/include/asm/plpks.h +2 -3
index 23b77027c916..7a84069759b0 100644
@@ -44,9 +44,8 @@
 #define PLPKS_MAX_DATA_SIZE		4000
 
 // Timeouts for PLPKS operations
-#define PLPKS_MAX_TIMEOUT		5000 // msec
-#define PLPKS_FLUSH_SLEEP		10 // msec
-#define PLPKS_FLUSH_SLEEP_RANGE		400
+#define PLPKS_MAX_TIMEOUT		(5 * USEC_PER_SEC)
+#define PLPKS_FLUSH_SLEEP		10000 // usec
 
 struct plpks_var {
 	char *component;
arch/powerpc/platforms/pseries/plpks.c +1 -2
index febe18f251d0..bcfcd5acc5c2 100644
@@ -415,8 +415,7 @@ static int plpks_confirm_object_flushed(struct label *label,
 			break;
 		}
 
-		usleep_range(PLPKS_FLUSH_SLEEP,
-			     PLPKS_FLUSH_SLEEP + PLPKS_FLUSH_SLEEP_RANGE);
+		fsleep(PLPKS_FLUSH_SLEEP);
 		timeout = timeout + PLPKS_FLUSH_SLEEP;
 	} while (timeout < PLPKS_MAX_TIMEOUT);
 
Signature · 1 line
2.31.1
#1 lore raw
Quoted 7 lines · Nayna Jain

usleep_range() function takes input time and range in usec. However, currently it is assumed in msec in the function plpks_confirm_object_flushed().

Fix the total polling time for the object flushing from 5msec to 5sec.

Quoted 6 lines
Fixes 2454a7af0f2a ("powerpc/pseries: define driver for Platform

KeyStore")

plpks_signed_update_var() also relies on PLPKS_MAX_TIMEOUT, and assumes it to be in milliseconds rather than microseconds.

Signature · 2 lines
Andrew Donnellan    OzLabs, ADL Canberra
[email protected]   IBM Australia Limited