]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/crypto/zcrypt_pcicc.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[linux-2.6-omap-h63xx.git] / drivers / s390 / crypto / zcrypt_pcicc.c
index f295a403b29a9bedccfbab6abab87370b30619d5..17ea56ce1c1141731a33790d800ca6b0de487529 100644 (file)
@@ -42,7 +42,7 @@
 #define PCICC_MAX_MOD_SIZE_OLD 128     /* 1024 bits */
 #define PCICC_MAX_MOD_SIZE     256     /* 2048 bits */
 
-/**
+/*
  * PCICC cards need a speed rating of 0. This keeps them at the end of
  * the zcrypt device list (see zcrypt_api.c). PCICC cards are only
  * used if no other cards are present because they are slow and can only
@@ -82,6 +82,7 @@ static struct ap_driver zcrypt_pcicc_driver = {
        .remove = zcrypt_pcicc_remove,
        .receive = zcrypt_pcicc_receive,
        .ids = zcrypt_pcicc_ids,
+       .request_timeout = PCICC_CLEANUP_TIME,
 };
 
 /**
@@ -387,7 +388,7 @@ static int convert_type86(struct zcrypt_device *zdev,
        reply_len = le16_to_cpu(msg->length) - 2;
        if (reply_len > outputdatalength)
                return -EINVAL;
-       /**
+       /*
         * For all encipher requests, the length of the ciphertext (reply_len)
         * will always equal the modulus length. For MEX decipher requests
         * the output needs to get padded. Minimum pad size is 10.
@@ -501,18 +502,13 @@ static long zcrypt_pcicc_modexpo(struct zcrypt_device *zdev,
                goto out_free;
        init_completion(&work);
        ap_queue_message(zdev->ap_dev, &ap_msg);
-       rc = wait_for_completion_interruptible_timeout(
-                               &work, PCICC_CLEANUP_TIME);
-       if (rc > 0)
+       rc = wait_for_completion_interruptible(&work);
+       if (rc == 0)
                rc = convert_response(zdev, &ap_msg, mex->outputdata,
                                      mex->outputdatalength);
-       else {
-               /* Signal pending or message timed out. */
+       else
+               /* Signal pending. */
                ap_cancel_message(zdev->ap_dev, &ap_msg);
-               if (rc == 0)
-                       /* Message timed out. */
-                       rc = -ETIME;
-       }
 out_free:
        free_page((unsigned long) ap_msg.message);
        return rc;
@@ -544,18 +540,13 @@ static long zcrypt_pcicc_modexpo_crt(struct zcrypt_device *zdev,
                goto out_free;
        init_completion(&work);
        ap_queue_message(zdev->ap_dev, &ap_msg);
-       rc = wait_for_completion_interruptible_timeout(
-                               &work, PCICC_CLEANUP_TIME);
-       if (rc > 0)
+       rc = wait_for_completion_interruptible(&work);
+       if (rc == 0)
                rc = convert_response(zdev, &ap_msg, crt->outputdata,
                                      crt->outputdatalength);
-       else {
-               /* Signal pending or message timed out. */
+       else
+               /* Signal pending. */
                ap_cancel_message(zdev->ap_dev, &ap_msg);
-               if (rc == 0)
-                       /* Message timed out. */
-                       rc = -ETIME;
-       }
 out_free:
        free_page((unsigned long) ap_msg.message);
        return rc;