Skip to content

Commit b5185ea

Browse files
hfreudehcahca
authored andcommitted
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 <[email protected]> Reviewed-by: Ingo Franzki <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent c4abe62 commit b5185ea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/s390/crypto/paes_s390.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,11 @@ static inline int convert_key(const u8 *key, unsigned int keylen,
199199

200200
pk->len = sizeof(pk->protkey);
201201

202-
/* try three times in case of busy card */
203-
for (rc = -EIO, i = 0; rc && i < 3; i++) {
202+
/*
203+
* In case of a busy card retry with increasing delay
204+
* of 200, 400, 800 and 1600 ms - in total 3 s.
205+
*/
206+
for (rc = -EIO, i = 0; rc && i < 5; i++) {
204207
if (rc == -EBUSY && msleep_interruptible((1 << i) * 100)) {
205208
rc = -EINTR;
206209
goto out;

0 commit comments

Comments
 (0)