Skip to content

Commit 0f67b43

Browse files
committed
Merge: Updates for powerpc longer H_CALLS
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6679 Description: Updates for powerpc longer H_CALLS JIRA: https://issues.redhat.com/browse/RHEL-79919 Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=67194264 Tested: Verified Brew build test kernel RPMs Signed-off-by: Mamatha Inamdar <[email protected]> commit 7843543 Author: Nayna Jain <[email protected]> Date: Wed Apr 17 23:12:30 2024 -0400 powerpc/pseries: make max polling consistent for longer H_CALLs Currently, plpks_confirm_object_flushed() function polls for 5msec in total instead of 5sec. Keep max polling time consistent for all the H_CALLs, which take longer than expected, to be 5sec. Also, make use of fsleep() everywhere to insert delay. Reported-by: Nageswara R Sastry <[email protected]> Fixes: 2454a7a ("powerpc/pseries: define driver for Platform KeyStore") Signed-off-by: Nayna Jain <[email protected]> Tested-by: Nageswara R Sastry <[email protected]> Reviewed-by: Andrew Donnellan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected] Signed-off-by: Mamatha Inamdar <[email protected]> Approved-by: Steve Best <[email protected]> Approved-by: Tony Camuso <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents 01379ac + 5939a67 commit 0f67b43

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

arch/powerpc/include/asm/plpks.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@
4444
#define PLPKS_MAX_DATA_SIZE 4000
4545

4646
// Timeouts for PLPKS operations
47-
#define PLPKS_MAX_TIMEOUT 5000 // msec
48-
#define PLPKS_FLUSH_SLEEP 10 // msec
49-
#define PLPKS_FLUSH_SLEEP_RANGE 400
47+
#define PLPKS_MAX_TIMEOUT (5 * USEC_PER_SEC)
48+
#define PLPKS_FLUSH_SLEEP 10000 // usec
5049

5150
struct plpks_var {
5251
char *component;

arch/powerpc/platforms/pseries/plpks.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ static int plpks_confirm_object_flushed(struct label *label,
415415
break;
416416
}
417417

418-
usleep_range(PLPKS_FLUSH_SLEEP,
419-
PLPKS_FLUSH_SLEEP + PLPKS_FLUSH_SLEEP_RANGE);
418+
fsleep(PLPKS_FLUSH_SLEEP);
420419
timeout = timeout + PLPKS_FLUSH_SLEEP;
421420
} while (timeout < PLPKS_MAX_TIMEOUT);
422421

@@ -464,9 +463,10 @@ int plpks_signed_update_var(struct plpks_var *var, u64 flags)
464463

465464
continuetoken = retbuf[0];
466465
if (pseries_status_to_err(rc) == -EBUSY) {
467-
int delay_ms = get_longbusy_msecs(rc);
468-
mdelay(delay_ms);
469-
timeout += delay_ms;
466+
int delay_us = get_longbusy_msecs(rc) * 1000;
467+
468+
fsleep(delay_us);
469+
timeout += delay_us;
470470
}
471471
rc = pseries_status_to_err(rc);
472472
} while (rc == -EBUSY && timeout < PLPKS_MAX_TIMEOUT);

0 commit comments

Comments
 (0)