summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.ibm.com>2025-05-21 10:01:18 +0200
committerHeiko Carstens <hca@linux.ibm.com>2025-05-21 12:02:27 +0200
commitb5185ea1a6bd35957e556129bb92a64f83aa65e4 (patch)
tree04edfde54dac6639a8739525259841106f8411c6
parentc4abe6234246c75cdc43326415d9cff88b7cf06c (diff)
s390/crypto: Extend protected key conversion retry loop
CI runs show that the protected key conversion retry loop runs into timeout if a master key change was initiated on the addressed crypto resource shortly before the conversion request. This patch extends the retry logic to run in total 5 attempts with increasing delay (200, 400, 800 and 1600 ms) in case of a busy card. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-rw-r--r--arch/s390/crypto/paes_s390.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/s390/crypto/paes_s390.c b/arch/s390/crypto/paes_s390.c
index 47f5ce7904f8..8a340c16acb4 100644
--- a/arch/s390/crypto/paes_s390.c
+++ b/arch/s390/crypto/paes_s390.c
@@ -199,8 +199,11 @@ static inline int convert_key(const u8 *key, unsigned int keylen,
pk->len = sizeof(pk->protkey);
- /* try three times in case of busy card */
- for (rc = -EIO, i = 0; rc && i < 3; i++) {
+ /*
+ * In case of a busy card retry with increasing delay
+ * of 200, 400, 800 and 1600 ms - in total 3 s.
+ */
+ for (rc = -EIO, i = 0; rc && i < 5; i++) {
if (rc == -EBUSY && msleep_interruptible((1 << i) * 100)) {
rc = -EINTR;
goto out;