summaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/zcrypt_cex2c.c
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.ibm.com>2019-11-22 16:30:06 +0100
committerVasily Gorbik <gor@linux.ibm.com>2020-01-09 16:59:18 +0100
commit0c874cd04292c7ee22d70eefc341fa2648f41f46 (patch)
tree2902a080a58180da1d8949f85a905b91943b725d /drivers/s390/crypto/zcrypt_cex2c.c
parent94dd3bada53ee77b80d0aeee5571eeb83654d156 (diff)
downloadlinux-0c874cd04292c7ee22d70eefc341fa2648f41f46.tar.bz2
s390/zcrypt: move ap device reset from bus to driver code
This patch moves the reset invocation of an ap device when fresh detected from the ap bus to the probe() function of the driver responsible for this device. The virtualisation of ap devices makes it necessary to remove unconditioned resets on fresh appearing apqn devices. It may be that such a device is already enabled for guest usage. So there may be a race condition between host ap bus and guest ap bus doing the reset. This patch moves the reset from the ap bus to the zcrypt drivers. So if there is no zcrypt driver bound to an ap device - for example the ap device is bound to the vfio device driver - the ap device is untouched passed to the vfio device driver. Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_cex2c.c')
-rw-r--r--drivers/s390/crypto/zcrypt_cex2c.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/crypto/zcrypt_cex2c.c b/drivers/s390/crypto/zcrypt_cex2c.c
index 35c7c6672713..c78c0d119806 100644
--- a/drivers/s390/crypto/zcrypt_cex2c.c
+++ b/drivers/s390/crypto/zcrypt_cex2c.c
@@ -220,6 +220,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev)
zq->queue = aq;
zq->online = 1;
atomic_set(&zq->load, 0);
+ ap_rapq(aq->qid);
rc = zcrypt_cex2c_rng_supported(aq);
if (rc < 0) {
zcrypt_queue_free(zq);
@@ -231,6 +232,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev)
else
zq->ops = zcrypt_msgtype(MSGTYPE06_NAME,
MSGTYPE06_VARIANT_NORNG);
+ ap_queue_init_state(aq);
ap_queue_init_reply(aq, &zq->reply);
aq->request_timeout = CEX2C_CLEANUP_TIME;
aq->private = zq;