s390/crypto: improve retry logic in case of master key change
authorHarald Freudenberger <freude@linux.ibm.com>
Fri, 15 Jan 2021 07:56:19 +0000 (08:56 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 27 Jan 2021 12:00:48 +0000 (13:00 +0100)
commit1daafea411f36cfa52eb58c2e7f9e2254fd42b28
tree9f021fede408ef47a1d0988a5cc1782481c539be
parente1bff843cde62a45a287b7f9b4cd5e824e8e49e2
s390/crypto: improve retry logic in case of master key change

A master key change on a CCA card may cause an immediately
following request to derive an protected key from a secure
key to fail with error condition 8/2290. The recommendation
from firmware is to retry with 1 second sleep.

So now the low level cca functions return -EAGAIN when this
error condition is seen and the paes retry function will
evaluate the return value. Seeing EAGAIN and running in
process context results in trying to sleep for 1 s now.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/crypto/paes_s390.c
drivers/s390/crypto/zcrypt_ccamisc.c