]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
crypto: cavium - Fix statistics pending request value
authorJan Glauber <jglauber@cavium.com>
Mon, 9 Apr 2018 15:45:53 +0000 (17:45 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Apr 2018 16:58:35 +0000 (00:58 +0800)
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>
drivers/crypto/cavium/zip/zip_main.c
drivers/crypto/cavium/zip/zip_main.h

index 79b449e0f955cf72fa0a486f054a795dd4837687..ae5b20c695caf9d1b0a69d166ff588ae93b3855f 100644 (file)
@@ -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;
index 64e051f607840cb6e19be334c723af8298c80ed0..e1e4fa92ce80567d53fcd48d11077abfa30eb6f3 100644 (file)
@@ -74,7 +74,6 @@ struct zip_stats {
        atomic64_t    comp_req_complete;
        atomic64_t    decomp_req_submit;
        atomic64_t    decomp_req_complete;
-       atomic64_t    pending_req;
        atomic64_t    comp_in_bytes;
        atomic64_t    comp_out_bytes;
        atomic64_t    decomp_in_bytes;