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)
commit43cb5a7c61186cde6eba344c43489b9cf95c68f8
tree8ef2cdb0bf51f4075b720e3dacd553dfff6f18fe
parent837cd1059a985ee610e4b72dcdddb287e7b97de0
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