crypto: Add error messages
When request for scaling bus fails, log error message.
Also do not return error on failing to service the
bus scaling request.
Change-Id: Ia893b3fe1b2b7b644ac2f44ed81fb2e33d451b4b
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
diff --git a/drivers/crypto/msm/qcedev.c b/drivers/crypto/msm/qcedev.c
index c1a65fc..fff494c 100644
--- a/drivers/crypto/msm/qcedev.c
+++ b/drivers/crypto/msm/qcedev.c
@@ -1,6 +1,6 @@
/* Qualcomm CE device driver.
*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -172,7 +172,7 @@
#endif
}
-static int qcedev_ce_high_bw_req(struct qcedev_control *podev,
+static void qcedev_ce_high_bw_req(struct qcedev_control *podev,
bool high_bw_req)
{
int ret = 0;
@@ -180,18 +180,22 @@
mutex_lock(&sent_bw_req);
if (high_bw_req) {
if (podev->high_bw_req_count == 0)
- msm_bus_scale_client_update_request(
+ ret = msm_bus_scale_client_update_request(
podev->bus_scale_handle, 1);
+ if (ret)
+ pr_err("%s Unable to set to high bandwidth\n",
+ __func__);
podev->high_bw_req_count++;
} else {
if (podev->high_bw_req_count == 1)
- msm_bus_scale_client_update_request(
+ ret = msm_bus_scale_client_update_request(
podev->bus_scale_handle, 0);
+ if (ret)
+ pr_err("%s Unable to set to low bandwidth\n",
+ __func__);
podev->high_bw_req_count--;
}
mutex_unlock(&sent_bw_req);
-
- return ret;
}
@@ -331,7 +335,7 @@
handle->cntl = podev;
file->private_data = handle;
if (podev->platform_support.bus_scale_table != NULL)
- return qcedev_ce_high_bw_req(podev, true);
+ qcedev_ce_high_bw_req(podev, true);
return 0;
}
@@ -349,7 +353,7 @@
kzfree(handle);
file->private_data = NULL;
if (podev->platform_support.bus_scale_table != NULL)
- return qcedev_ce_high_bw_req(podev, false);
+ qcedev_ce_high_bw_req(podev, false);
return 0;
}
@@ -2218,7 +2222,7 @@
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Mona Hossain <mhossain@codeaurora.org>");
MODULE_DESCRIPTION("Qualcomm DEV Crypto driver");
-MODULE_VERSION("1.25");
+MODULE_VERSION("1.26");
module_init(qcedev_init);
module_exit(qcedev_exit);
diff --git a/drivers/crypto/msm/qcrypto.c b/drivers/crypto/msm/qcrypto.c
index 3fff05c..21c3aff 100644
--- a/drivers/crypto/msm/qcrypto.c
+++ b/drivers/crypto/msm/qcrypto.c
@@ -1,6 +1,6 @@
/* Qualcomm Crypto driver
*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -329,7 +329,7 @@
}
}
-static int qcrypto_ce_high_bw_req(struct crypto_priv *cp, bool high_bw_req)
+static void qcrypto_ce_high_bw_req(struct crypto_priv *cp, bool high_bw_req)
{
int ret = 0;
@@ -338,16 +338,20 @@
if (cp->high_bw_req_count == 0)
ret = msm_bus_scale_client_update_request(
cp->bus_scale_handle, 1);
+ if (ret)
+ pr_err("%s Unable to set to high bandwidth\n",
+ __func__);
cp->high_bw_req_count++;
} else {
if (cp->high_bw_req_count == 1)
ret = msm_bus_scale_client_update_request(
cp->bus_scale_handle, 0);
+ if (ret)
+ pr_err("%s Unable to set to low bandwidth\n",
+ __func__);
cp->high_bw_req_count--;
}
mutex_unlock(&sent_bw_req);
-
- return ret;
}
static void _start_qcrypto_process(struct crypto_priv *cp);
@@ -403,7 +407,7 @@
/* random first IV */
get_random_bytes(ctx->iv, QCRYPTO_MAX_IV_LENGTH);
if (ctx->cp->platform_support.bus_scale_table != NULL)
- return qcrypto_ce_high_bw_req(ctx->cp, true);
+ qcrypto_ce_high_bw_req(ctx->cp, true);
return 0;
};
@@ -440,7 +444,7 @@
sha_ctx->ahash_req = NULL;
if (sha_ctx->cp->platform_support.bus_scale_table != NULL)
- return qcrypto_ce_high_bw_req(sha_ctx->cp, true);
+ qcrypto_ce_high_bw_req(sha_ctx->cp, true);
return 0;
};
@@ -3359,4 +3363,4 @@
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Mona Hossain <mhossain@codeaurora.org>");
MODULE_DESCRIPTION("Qualcomm Crypto driver");
-MODULE_VERSION("1.20");
+MODULE_VERSION("1.21");