Commit 8893d27f authored by Giovanni Cabiddu's avatar Giovanni Cabiddu Committed by Herbert Xu
Browse files

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: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fd11727e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -75,6 +75,13 @@ static int adf_crypto_dev_config(struct adf_accel_dev *accel_dev)
	if (ret)
		goto err;

	/* Temporarily set the number of crypto instances to zero to avoid
	 * registering the crypto algorithms.
	 * This will be removed when the algorithms will support the
	 * CRYPTO_TFM_REQ_MAY_BACKLOG flag
	 */
	instances = 0;

	for (i = 0; i < instances; i++) {
		val = i;
		bank = i * 2;
+7 −0
Original line number Diff line number Diff line
@@ -161,6 +161,13 @@ int qat_crypto_dev_config(struct adf_accel_dev *accel_dev)
	if (ret)
		goto err;

	/* Temporarily set the number of crypto instances to zero to avoid
	 * registering the crypto algorithms.
	 * This will be removed when the algorithms will support the
	 * CRYPTO_TFM_REQ_MAY_BACKLOG flag
	 */
	instances = 0;

	for (i = 0; i < instances; i++) {
		val = i;
		snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_BANK_NUM, i);