From patchwork Mon Apr 9 15:45:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Glauber X-Patchwork-Id: 10331711 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B755A6020F for ; Mon, 9 Apr 2018 15:47:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9C8928793 for ; Mon, 9 Apr 2018 15:47:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E436288EA; Mon, 9 Apr 2018 15:47:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47FE7287DA for ; Mon, 9 Apr 2018 15:47:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251AbeDIPqn (ORCPT ); Mon, 9 Apr 2018 11:46:43 -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-Google-Smtp-Source: AIpwx4/f2DiriwaAQRNe6HMIfXnsQfS7WDEtWhre4uh0kN+iNPq+wRZ/+pG0SzmkzIhf42xCINTwuQ== 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-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;