From: Dan Carpenter <dan.carpenter@oracle.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Bruce Allan <bruce.w.allan@intel.com>,
Pingchao Yang <pingchao.yang@intel.com>,
qat-linux@intel.com, linux-crypto@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [patch] crypto: qat - fix some timeout tests
Date: Tue, 15 Dec 2015 10:05:15 +0000 [thread overview]
Message-ID: <20151215100515.GB20848@mwanda> (raw)
We do an "if (!times)" test later to see if we ran the loop too many
times, but because it is a postop negate that means times is -1 when we
exit that way. I have fixed this by changing it from a post op to a
preop.
Fixes: b3416fb8a2f5 ('crypto: qat - Intel(R) QAT accelengine part of fw loader')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This means we only loop 9999 times instead of 10000 like before but I
figure it probably doesn't matter.
diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c
index 45c1739..2b078a6 100644
--- a/drivers/crypto/qat/qat_common/qat_hal.c
+++ b/drivers/crypto/qat/qat_common/qat_hal.c
@@ -171,7 +171,7 @@ static int qat_hal_wait_cycles(struct icp_qat_fw_loader_handle *handle,
qat_hal_rd_ae_csr(handle, ae, PROFILE_COUNT, &base_cnt);
base_cnt &= 0xffff;
- while ((int)cycles > elapsed_cycles && times--) {
+ while ((int)cycles > elapsed_cycles && --times) {
if (chk_inactive)
qat_hal_rd_ae_csr(handle, ae, ACTIVE_CTX_STATUS, &csr);
next reply other threads:[~2015-12-15 10:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 10:05 Dan Carpenter [this message]
2015-12-15 20:27 ` [patch] crypto: qat - fix some timeout tests Tadeusz Struk
2015-12-15 23:50 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2015-12-16 6:09 [PATCH] " Yang Pingchao
2015-12-22 13:23 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151215100515.GB20848@mwanda \
--to=dan.carpenter@oracle.com \
--cc=bruce.w.allan@intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=pingchao.yang@intel.com \
--cc=qat-linux@intel.com \
--cc=tadeusz.struk@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox