]> www.infradead.org Git - users/dwmw2/linux.git/commit
s390/zcrypt: introduce retries on in-kernel send CPRB functions
authorHarald Freudenberger <freude@linux.ibm.com>
Fri, 26 Jan 2024 14:43:10 +0000 (15:43 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Mar 2024 13:41:14 +0000 (14:41 +0100)
commit77c51fc6fba7af918db58808d38513f21e91493d
tree2afd0db547cb97f561555aad3d07973a91b0687e
parenteacf5b3651c530e0666efbd64e1d1115258c5903
s390/zcrypt: introduce retries on in-kernel send CPRB functions

The both functions zcrypt_send_cprb() and zcrypt_send_ep11_cprb()
are used to send CPRBs in-kernel from different sources. For
example the pkey module may call one of the functions in
zcrypt_ep11misc.c to trigger a derive of a protected key from
a secure key blob via an existing crypto card. These both
functions are then the internal API to send the CPRB and
receive the response.

All the ioctl functions to send an CPRB down to the addressed
crypto card use some kind of retry mechanism. When the first
attempt fails with ENODEV, a bus rescan is triggered and a
loop with retries is carried out.

For the both named internal functions there was never any
retry attempt made. This patch now introduces the retry code
even for this both internal functions to have effectively
same behavior on sending an CPRB from an in-kernel source
and sending an CPRB from userspace via ioctl.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/crypto/zcrypt_api.c