Received: by 10.213.65.68 with SMTP id h4csp2775920imn; Mon, 9 Apr 2018 08:51:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ZxiQvnzPWQy9BMF11t5VD6fbgzYA8OpHpUH31+bXaqS0vGtTfkuVh7K21mcYYau4A3CRp X-Received: by 10.98.66.203 with SMTP id h72mr29591777pfd.156.1523289095193; Mon, 09 Apr 2018 08:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523289095; cv=none; d=google.com; s=arc-20160816; b=S3fOLbKh5ml1YgwmprPPEp4kMv2C6vruEpDU3bjmOhpVHpnRTikK3NoNXezEzrLhdX Ihru6qylxWSwrn7aJkyFjZCgWpwEILWxp7gUSXMRw+v2YZSoh4yqvI3/mtov4fvZ6Dqg m9pwdlkU7/enV6m9A5A9yKupIgQOyN+anw6PN6Deh70VGGH06N6m9VFQEW3pZW2oNSPA xhSw01Rpan3gDeQTg5f4fBH1pTC4kBeaQ+fP2XDXVkFqPo4r1EUrweJsKDVSLZuwb0W/ DLD1KP7FivLRh7mXTaomxSlcp6NWk/SV56s33/EcWOx7M1Al6LUi/N1kG59KVP5wf7jx tp3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=QuILFLsiodvuFE/fb+RyU7eBKuULiz3plLJrAZdngCI=; b=U0/FXDCXcHpLR7zlq0mLlRitAFxWnpx06FAASDf7yH7GclwDF4uBSRnt/2S8+O3doi 4lWuTN6DBxo+RDSNpjVooY3IDGuQZE9rxHanuRM9Dn5QXktBzrJbg6ezKK61o6/9x8FS jkwPD7CkqwNhltre1s+FsrDLtn9qQjAwDrfGCACTq/AhISU5UBDp2cRwmYELVvKfVDVK Zghf1zSKotDKrgk9erLMixjq+6f/nRTWUMRvjMgp/npkNbt+j5F4o7Oh78mE8jTJCHfR bABJFA1cL59d3SP10fZwtd8w3r/cypitithgIM+JkM+SqnmCtw6w6CCmx+SxvasFU5v+ C3zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4si397169pgs.571.2018.04.09.08.50.58; Mon, 09 Apr 2018 08:51:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753275AbeDIPqp (ORCPT + 99 others); Mon, 9 Apr 2018 11:46:45 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54950 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753211AbeDIPql (ORCPT ); Mon, 9 Apr 2018 11:46:41 -0400 Received: by mail-wm0-f68.google.com with SMTP id r191so20026440wmg.4; Mon, 09 Apr 2018 08:46:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QuILFLsiodvuFE/fb+RyU7eBKuULiz3plLJrAZdngCI=; b=HZh86kQKLNgCbbM2EkX0FJ/zgVDiN67eAs4g0IZtpzCyI/aTWkjuzyOBX+57SwikEo jrmQCp5T/QC+PRFdaPBlM2ZEl9m2bYIP5cXBI8hCWWj7h37qi7C8VLClphYisRGXYK7l EHUx1ofY8zByrmPf7rDGVPRJ7E/txqbvhfyf8v9bExOlllIpopVnohQjw2OQbq9njRoW /J2OI758pNQqoHsAIH8E350d+wfW1WkAwhUz1G2H5i8roZhKGVsNFRCS30BioVOfzQNb enhp1668XIOEA3INCuDXPPjASxRMx3xc0t0GKsdNs/qFpwJ/w1rO5wphjmyoi2vKdsMo EyIA== X-Gm-Message-State: ALQs6tCE8u/Mp2gbHsB47fC8ZJzxDB1tr7c9C1MdGuM1zhk/YrkERc5Z 2ORJZizS/hIbK9A4aZ8m0xo= X-Received: by 10.28.193.13 with SMTP id r13mr339260wmf.38.1523288799537; Mon, 09 Apr 2018 08:46:39 -0700 (PDT) Received: from wintermute.fritz.box (HSI-KBW-078-043-196-194.hsi4.kabel-badenwuerttemberg.de. [78.43.196.194]) by smtp.gmail.com with ESMTPSA id w40sm881163wrc.33.2018.04.09.08.46.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 08:46:38 -0700 (PDT) From: Jan Glauber To: Herbert Xu Cc: "David S . Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Mahipal Challa , Robert Richter , Jan Glauber Subject: [PATCH v2 4/5] crypto: thunderx_zip: Fix statistics pending request value Date: Mon, 9 Apr 2018 17:45:53 +0200 Message-Id: <20180409154554.7578-5-jglauber@cavium.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180409154554.7578-1-jglauber@cavium.com> References: <20180409154554.7578-1-jglauber@cavium.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Robert Richter --- drivers/crypto/cavium/zip/zip_main.c | 13 +++++-------- drivers/crypto/cavium/zip/zip_main.h | 1 - 2 files changed, 5 insertions(+), 9 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; diff --git a/drivers/crypto/cavium/zip/zip_main.h b/drivers/crypto/cavium/zip/zip_main.h index 64e051f60784..e1e4fa92ce80 100644 --- a/drivers/crypto/cavium/zip/zip_main.h +++ b/drivers/crypto/cavium/zip/zip_main.h @@ -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; -- 2.16.2