Message ID | 20240314041735.1171434-1-nayna@linux.ibm.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [v2] powerpc/pseries: fix max polling time in plpks_confirm_object_flushed() function | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/github-powerpc_ppctests | success | Successfully ran 8 jobs. |
snowpatch_ozlabs/github-powerpc_selftests | success | Successfully ran 8 jobs. |
snowpatch_ozlabs/github-powerpc_sparse | success | Successfully ran 4 jobs. |
snowpatch_ozlabs/github-powerpc_clang | success | Successfully ran 6 jobs. |
snowpatch_ozlabs/github-powerpc_kernel_qemu | success | Successfully ran 23 jobs. |
On Thu, 2024-03-14 at 00:17 -0400, Nayna Jain wrote: > 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. > > Reported-by: Nageswara R Sastry <rnsastry@linux.ibm.com> > Fixes: 2454a7af0f2a ("powerpc/pseries: define driver for Platform > KeyStore") > Suggested-by: Michael Ellerman <mpe@ellerman.id.au> > Signed-off-by: Nayna Jain <nayna@linux.ibm.com> > Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com> plpks_signed_update_var() also relies on PLPKS_MAX_TIMEOUT, and assumes it to be in milliseconds rather than microseconds.
diff --git a/arch/powerpc/include/asm/plpks.h b/arch/powerpc/include/asm/plpks.h index 23b77027c916..7a84069759b0 100644 --- a/arch/powerpc/include/asm/plpks.h +++ b/arch/powerpc/include/asm/plpks.h @@ -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; diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c index febe18f251d0..bcfcd5acc5c2 100644 --- a/arch/powerpc/platforms/pseries/plpks.c +++ b/arch/powerpc/platforms/pseries/plpks.c @@ -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);