Browse Source

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>
Heiko Carstens 10 years ago
parent
commit
e4e1899aae
2 changed files with 2 additions and 2 deletions
  1. 1 1
      drivers/s390/crypto/ap_bus.c
  2. 1 1
      drivers/s390/crypto/zcrypt_pcixcc.c

+ 1 - 1
drivers/s390/crypto/ap_bus.c

@@ -1372,7 +1372,7 @@ static int ap_probe_device_type(struct ap_device *ap_dev)
 
 
 	/* Wait for the test message to complete. */
 	/* Wait for the test message to complete. */
 	for (i = 0; i < 6; i++) {
 	for (i = 0; i < 6; i++) {
-		mdelay(300);
+		msleep(300);
 		status = __ap_recv(ap_dev->qid, &psmid, reply, 4096);
 		status = __ap_recv(ap_dev->qid, &psmid, reply, 4096);
 		if (status.response_code == AP_RESPONSE_NORMAL &&
 		if (status.response_code == AP_RESPONSE_NORMAL &&
 		    psmid == 0x0102030405060708ULL)
 		    psmid == 0x0102030405060708ULL)

+ 1 - 1
drivers/s390/crypto/zcrypt_pcixcc.c

@@ -182,7 +182,7 @@ static int zcrypt_pcixcc_mcl(struct ap_device *ap_dev)
 
 
 	/* Wait for the test message to complete. */
 	/* Wait for the test message to complete. */
 	for (i = 0; i < 6; i++) {
 	for (i = 0; i < 6; i++) {
-		mdelay(300);
+		msleep(300);
 		rc = ap_recv(ap_dev->qid, &psmid, reply, 4096);
 		rc = ap_recv(ap_dev->qid, &psmid, reply, 4096);
 		if (rc == 0 && psmid == 0x0102030405060708ULL)
 		if (rc == 0 && psmid == 0x0102030405060708ULL)
 			break;
 			break;