]> git.baikalelectronics.ru Git - kernel.git/commit
s390/zcrypt/pkey: introduce zcrypt_wait_api_operational() function
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 1 Sep 2020 10:48:14 +0000 (12:48 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Nov 2020 10:21:00 +0000 (11:21 +0100)
commitdd885ca4de78cf9dfb436d16d2a1cd9bf469985e
tree8ef2cdb0bf51f4075b720e3dacd553dfff6f18fe
parent53e5054936cf292ff07c5a7624d1793ccee2dc45
s390/zcrypt/pkey: introduce zcrypt_wait_api_operational() function

The zcrypt api provides a new function to wait until the zcrypt
api is operational:

  int zcrypt_wait_api_operational(void);

The AP bus scan and the binding of ap devices to device drivers is
an asynchronous job. This function waits until these initial jobs
are done and so the zcrypt api should be ready to serve crypto
requests - if there are resources available. The function uses an
internal timeout of 60s. The very first caller will either wait for
ap bus bindings complete or the timeout happens. This state will be
remembered for further callers which will only be blocked until a
decision is made (timeout or bindings complete).

Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/crypto/pkey_api.c
drivers/s390/crypto/zcrypt_api.c
drivers/s390/crypto/zcrypt_api.h