]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/crypto/zcrypt_pcixcc.c
Pull sbs into release branch
[linux-2.6-omap-h63xx.git] / drivers / s390 / crypto / zcrypt_pcixcc.c
index b7153c1e15cdea786c2fb7c9d453213aaddda39d..64948788d30157c7237d43a68a8d3cdac509509f 100644 (file)
@@ -93,6 +93,7 @@ static struct ap_driver zcrypt_pcixcc_driver = {
        .remove = zcrypt_pcixcc_remove,
        .receive = zcrypt_pcixcc_receive,
        .ids = zcrypt_pcixcc_ids,
+       .request_timeout = PCIXCC_CLEANUP_TIME,
 };
 
 /**
@@ -641,18 +642,13 @@ static long zcrypt_pcixcc_modexpo(struct zcrypt_device *zdev,
                goto out_free;
        init_completion(&resp_type.work);
        ap_queue_message(zdev->ap_dev, &ap_msg);
-       rc = wait_for_completion_interruptible_timeout(
-                               &resp_type.work, PCIXCC_CLEANUP_TIME);
-       if (rc > 0)
+       rc = wait_for_completion_interruptible(&resp_type.work);
+       if (rc == 0)
                rc = convert_response_ica(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;
@@ -685,18 +681,13 @@ static long zcrypt_pcixcc_modexpo_crt(struct zcrypt_device *zdev,
                goto out_free;
        init_completion(&resp_type.work);
        ap_queue_message(zdev->ap_dev, &ap_msg);
-       rc = wait_for_completion_interruptible_timeout(
-                               &resp_type.work, PCIXCC_CLEANUP_TIME);
-       if (rc > 0)
+       rc = wait_for_completion_interruptible(&resp_type.work);
+       if (rc == 0)
                rc = convert_response_ica(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;
@@ -709,7 +700,8 @@ out_free:
  *       PCIXCC/CEX2C device to the request distributor
  * @xcRB: pointer to the send_cprb request buffer
  */
-long zcrypt_pcixcc_send_cprb(struct zcrypt_device *zdev, struct ica_xcRB *xcRB)
+static long zcrypt_pcixcc_send_cprb(struct zcrypt_device *zdev,
+                                   struct ica_xcRB *xcRB)
 {
        struct ap_message ap_msg;
        struct response_type resp_type = {
@@ -728,17 +720,12 @@ long zcrypt_pcixcc_send_cprb(struct zcrypt_device *zdev, struct ica_xcRB *xcRB)
                goto out_free;
        init_completion(&resp_type.work);
        ap_queue_message(zdev->ap_dev, &ap_msg);
-       rc = wait_for_completion_interruptible_timeout(
-                               &resp_type.work, PCIXCC_CLEANUP_TIME);
-       if (rc > 0)
+       rc = wait_for_completion_interruptible(&resp_type.work);
+       if (rc == 0)
                rc = convert_response_xcrb(zdev, &ap_msg, xcRB);
-       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:
        memset(ap_msg.message, 0x0, ap_msg.length);
        kfree(ap_msg.message);