summaryrefslogtreecommitdiff
path: root/drivers/crypto/cavium/zip/zip_main.c
diff options
context:
space:
mode:
authorJan Glauber <jglauber@cavium.com>2018-04-09 18:45:53 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-04-20 19:58:35 +0300
commit1cc7e01ff977770ce0651f4d347a84e360835c3b (patch)
tree33811a8d24d116ab032672f690f56e73040b0be6 /drivers/crypto/cavium/zip/zip_main.c
parenta40c88045506ecba8e3ae75da19e8a2c53e23a41 (diff)
downloadlinux-1cc7e01ff977770ce0651f4d347a84e360835c3b.tar.xz
crypto: cavium - Fix statistics pending request value
The pending request counter was read from the wrong register. While at it, there is no need to use an atomic for it as it is only read localy in a loop. Signed-off-by: Jan Glauber <jglauber@cavium.com> Reviewed-by: Robert Richter <rrichter@cavium.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/cavium/zip/zip_main.c')
-rw-r--r--drivers/crypto/cavium/zip/zip_main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/crypto/cavium/zip/zip_main.c b/drivers/crypto/cavium/zip/zip_main.c
index 79b449e0f955..ae5b20c695ca 100644
--- a/drivers/crypto/cavium/zip/zip_main.c
+++ b/drivers/crypto/cavium/zip/zip_main.c
@@ -469,6 +469,8 @@ static int zip_show_stats(struct seq_file *s, void *unused)
struct zip_stats *st;
for (index = 0; index < MAX_ZIP_DEVICES; index++) {
+ u64 pending = 0;
+
if (zip_dev[index]) {
zip = zip_dev[index];
st = &zip->stats;
@@ -476,10 +478,8 @@ static int zip_show_stats(struct seq_file *s, void *unused)
/* Get all the pending requests */
for (q = 0; q < ZIP_NUM_QUEUES; q++) {
val = zip_reg_read((zip->reg_base +
- ZIP_DBG_COREX_STA(q)));
- val = (val >> 32);
- val = val & 0xffffff;
- atomic64_add(val, &st->pending_req);
+ ZIP_DBG_QUEX_STA(q)));
+ pending += val >> 32 & 0xffffff;
}
val = atomic64_read(&st->comp_req_complete);
@@ -514,10 +514,7 @@ static int zip_show_stats(struct seq_file *s, void *unused)
(u64)atomic64_read(&st->decomp_in_bytes),
(u64)atomic64_read(&st->decomp_out_bytes),
(u64)atomic64_read(&st->decomp_bad_reqs),
- (u64)atomic64_read(&st->pending_req));
-
- /* Reset pending requests count */
- atomic64_set(&st->pending_req, 0);
+ pending);
}
}
return 0;