Skip to content

Commit ed6776c

Browse files
hfreudehcahca
authored andcommitted
s390/crypto: remove retry loop with sleep from PAES pkey invocation
Upon calling the pkey module to (re-)derive an protected key from a secure key the PAES implementation did a retry 3 times with an 1000 ms sleep after each failure. This patch removes this retry loop - retries should be done if needed in a lower layer but the consumer of the pkey module functions should not be bothered with retries. Signed-off-by: Harald Freudenberger <[email protected]> Reviewed-by: Holger Dengler <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 5dabfec commit ed6776c

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

arch/s390/crypto/paes_s390.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,8 @@ struct s390_pxts_ctx {
125125
static inline int __paes_keyblob2pkey(struct key_blob *kb,
126126
struct pkey_protkey *pk)
127127
{
128-
int i, ret;
129-
130-
/* try three times in case of failure */
131-
for (i = 0; i < 3; i++) {
132-
if (i > 0 && ret == -EAGAIN && in_task())
133-
if (msleep_interruptible(1000))
134-
return -EINTR;
135-
ret = pkey_keyblob2pkey(kb->key, kb->keylen,
136-
pk->protkey, &pk->len, &pk->type);
137-
if (ret == 0)
138-
break;
139-
}
140-
141-
return ret;
128+
return pkey_keyblob2pkey(kb->key, kb->keylen,
129+
pk->protkey, &pk->len, &pk->type);
142130
}
143131

144132
static inline int __paes_convert_key(struct s390_paes_ctx *ctx)

0 commit comments

Comments
 (0)