diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2015-08-17 01:59:47 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-08-19 04:40:26 -0400 |
commit | e4e1899aaec0370aea6b98597ee6289d60544ae2 (patch) | |
tree | a25d5c833d1f0d00a5ab87e2c50c205ee11e765e | |
parent | e619cd3d618672bea8602d682ea63b42a1faf1bc (diff) |
s390/zcrypt: use msleep() instead of mdelay()
There is no need to busy loop and monopolize a cpu for up to ~2 seconds.
The code in question that calls mdelay() is preemptible anyway, so better
let the kernel schedule different processes than just looping and causing
unnecessary delays.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/crypto/ap_bus.c | 2 | ||||
-rw-r--r-- | drivers/s390/crypto/zcrypt_pcixcc.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 559a9dcdb15d..d78b3d629d78 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -1372,7 +1372,7 @@ static int ap_probe_device_type(struct ap_device *ap_dev) | |||
1372 | 1372 | ||
1373 | /* Wait for the test message to complete. */ | 1373 | /* Wait for the test message to complete. */ |
1374 | for (i = 0; i < 6; i++) { | 1374 | for (i = 0; i < 6; i++) { |
1375 | mdelay(300); | 1375 | msleep(300); |
1376 | status = __ap_recv(ap_dev->qid, &psmid, reply, 4096); | 1376 | status = __ap_recv(ap_dev->qid, &psmid, reply, 4096); |
1377 | if (status.response_code == AP_RESPONSE_NORMAL && | 1377 | if (status.response_code == AP_RESPONSE_NORMAL && |
1378 | psmid == 0x0102030405060708ULL) | 1378 | psmid == 0x0102030405060708ULL) |
diff --git a/drivers/s390/crypto/zcrypt_pcixcc.c b/drivers/s390/crypto/zcrypt_pcixcc.c index 899ffa19f5ec..f41852768953 100644 --- a/drivers/s390/crypto/zcrypt_pcixcc.c +++ b/drivers/s390/crypto/zcrypt_pcixcc.c | |||
@@ -182,7 +182,7 @@ static int zcrypt_pcixcc_mcl(struct ap_device *ap_dev) | |||
182 | 182 | ||
183 | /* Wait for the test message to complete. */ | 183 | /* Wait for the test message to complete. */ |
184 | for (i = 0; i < 6; i++) { | 184 | for (i = 0; i < 6; i++) { |
185 | mdelay(300); | 185 | msleep(300); |
186 | rc = ap_recv(ap_dev->qid, &psmid, reply, 4096); | 186 | rc = ap_recv(ap_dev->qid, &psmid, reply, 4096); |
187 | if (rc == 0 && psmid == 0x0102030405060708ULL) | 187 | if (rc == 0 && psmid == 0x0102030405060708ULL) |
188 | break; | 188 | break; |