summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorHarvijay Saini <harvijayx.saini@intel.com>2015-12-09 22:59:45 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2015-12-11 17:55:16 +0300
commit06cabd755a97325cd5f53e73153fd10f4ea51cb7 (patch)
tree7f4b372fd31e1f63eb30f430796bed56a32f5469 /drivers/crypto
parente14a1f1e36e76580c1094694f2f666ac582b34df (diff)
downloadlinux-06cabd755a97325cd5f53e73153fd10f4ea51cb7.tar.xz
crypto: qat - ring returning retry even though ring has BW
When many threads submit multiple requests they get blocked until all responses are processed, which prevents them from submitting more requests even though there is space on the rings. To fix this we need to decrement the inflight counter early to in the callback. Signed-off-by: Harvijay Saini <harvijayx.saini@intel.com> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/qat/qat_common/adf_transport.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_transport.c b/drivers/crypto/qat/qat_common/adf_transport.c
index eff00cd282e5..a6f3766a74f0 100644
--- a/drivers/crypto/qat/qat_common/adf_transport.c
+++ b/drivers/crypto/qat/qat_common/adf_transport.c
@@ -141,6 +141,7 @@ static int adf_handle_response(struct adf_etr_ring_data *ring)
while (*msg != ADF_RING_EMPTY_SIG) {
ring->callback((uint32_t *)msg);
+ atomic_dec(ring->inflights);
*msg = ADF_RING_EMPTY_SIG;
ring->head = adf_modulo(ring->head +
ADF_MSG_SIZE_TO_BYTES(ring->msg_size),
@@ -148,12 +149,10 @@ static int adf_handle_response(struct adf_etr_ring_data *ring)
msg_counter++;
msg = (uint32_t *)((uintptr_t)ring->base_addr + ring->head);
}
- if (msg_counter > 0) {
+ if (msg_counter > 0)
WRITE_CSR_RING_HEAD(ring->bank->csr_addr,
ring->bank->bank_number,
ring->ring_number, ring->head);
- atomic_sub(msg_counter, ring->inflights);
- }
return 0;
}