summaryrefslogtreecommitdiff
path: root/drivers/s390/crypto/zcrypt_cex4.c
diff options
context:
space:
mode:
authorIngo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>2016-07-25 12:52:28 (GMT)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-07-31 09:27:58 (GMT)
commitd6d86c57d77d466df2096b134e5f54463d3f0fb8 (patch)
treee228aa3826f9e587db7c2d5f88e0e6f36da78477 /drivers/s390/crypto/zcrypt_cex4.c
parent4475aeb8b77db34dea96b09900ba0cb245b6fb42 (diff)
downloadlinux-d6d86c57d77d466df2096b134e5f54463d3f0fb8.tar.xz
s390/zcrypt: Fix zcrypt suspend/resume behavior
The device suspend call triggers all ap devices to fetch potentially available response messages from the queues. Therefore the corresponding zcrypt device, that is allocated asynchronously after ap device probing, needs to be fully prepared. This race condition could lead to uninitialized response buffers while trying to read from the queues. Introduce a new callback within the ap layer to get noticed when a zcrypt device is fully prepared. Additional checks prevent reading from devices that are not fully prepared. Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_cex4.c')
-rw-r--r--drivers/s390/crypto/zcrypt_cex4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/crypto/zcrypt_cex4.c b/drivers/s390/crypto/zcrypt_cex4.c
index bb39088..ccb2e78 100644
--- a/drivers/s390/crypto/zcrypt_cex4.c
+++ b/drivers/s390/crypto/zcrypt_cex4.c
@@ -147,7 +147,7 @@ static int zcrypt_cex4_probe(struct ap_device *ap_dev)
return -ENODEV;
zdev->ap_dev = ap_dev;
zdev->online = 1;
- ap_dev->reply = &zdev->reply;
+ ap_device_init_reply(ap_dev, &zdev->reply);
ap_dev->private = zdev;
rc = zcrypt_device_register(zdev);
if (rc) {