Skip to content

Commit 8893d27

Browse files
gcabidduherbertx
authored andcommitted
crypto: qat - disable registration of algorithms
The implementations of aead and skcipher in the QAT driver do not support properly requests with the CRYPTO_TFM_REQ_MAY_BACKLOG flag set. If the HW queue is full, the driver returns -EBUSY but does not enqueue the request. This can result in applications like dm-crypt waiting indefinitely for a completion of a request that was never submitted to the hardware. To avoid this problem, disable the registration of all crypto algorithms in the QAT driver by setting the number of crypto instances to 0 at configuration time. Cc: stable@vger.kernel.org Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent fd11727 commit 8893d27

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/crypto/qat/qat_4xxx/adf_drv.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ static int adf_crypto_dev_config(struct adf_accel_dev *accel_dev)
7575
if (ret)
7676
goto err;
7777

78+
/* Temporarily set the number of crypto instances to zero to avoid
79+
* registering the crypto algorithms.
80+
* This will be removed when the algorithms will support the
81+
* CRYPTO_TFM_REQ_MAY_BACKLOG flag
82+
*/
83+
instances = 0;
84+
7885
for (i = 0; i < instances; i++) {
7986
val = i;
8087
bank = i * 2;

drivers/crypto/qat/qat_common/qat_crypto.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ int qat_crypto_dev_config(struct adf_accel_dev *accel_dev)
161161
if (ret)
162162
goto err;
163163

164+
/* Temporarily set the number of crypto instances to zero to avoid
165+
* registering the crypto algorithms.
166+
* This will be removed when the algorithms will support the
167+
* CRYPTO_TFM_REQ_MAY_BACKLOG flag
168+
*/
169+
instances = 0;
170+
164171
for (i = 0; i < instances; i++) {
165172
val = i;
166173
snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_BANK_NUM, i);

0 commit comments

Comments
 (0)