Commit 8a2514c0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'v6.8-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "Fix regressions in caam and qat"

* tag 'v6.8-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - fix asynchronous hash
  crypto: qat - fix arbiter mapping generation algorithm for QAT 402xx
parents 6d805afa c5a2f74d
...@@ -4545,6 +4545,7 @@ struct caam_hash_alg { ...@@ -4545,6 +4545,7 @@ struct caam_hash_alg {
struct list_head entry; struct list_head entry;
struct device *dev; struct device *dev;
int alg_type; int alg_type;
bool is_hmac;
struct ahash_alg ahash_alg; struct ahash_alg ahash_alg;
}; };
...@@ -4571,7 +4572,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) ...@@ -4571,7 +4572,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm)
ctx->dev = caam_hash->dev; ctx->dev = caam_hash->dev;
if (alg->setkey) { if (caam_hash->is_hmac) {
ctx->adata.key_dma = dma_map_single_attrs(ctx->dev, ctx->key, ctx->adata.key_dma = dma_map_single_attrs(ctx->dev, ctx->key,
ARRAY_SIZE(ctx->key), ARRAY_SIZE(ctx->key),
DMA_TO_DEVICE, DMA_TO_DEVICE,
...@@ -4611,7 +4612,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) ...@@ -4611,7 +4612,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm)
* For keyed hash algorithms shared descriptors * For keyed hash algorithms shared descriptors
* will be created later in setkey() callback * will be created later in setkey() callback
*/ */
return alg->setkey ? 0 : ahash_set_sh_desc(ahash); return caam_hash->is_hmac ? 0 : ahash_set_sh_desc(ahash);
} }
static void caam_hash_cra_exit(struct crypto_tfm *tfm) static void caam_hash_cra_exit(struct crypto_tfm *tfm)
...@@ -4646,12 +4647,14 @@ static struct caam_hash_alg *caam_hash_alloc(struct device *dev, ...@@ -4646,12 +4647,14 @@ static struct caam_hash_alg *caam_hash_alloc(struct device *dev,
template->hmac_name); template->hmac_name);
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
template->hmac_driver_name); template->hmac_driver_name);
t_alg->is_hmac = true;
} else { } else {
snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s", snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
template->name); template->name);
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
template->driver_name); template->driver_name);
t_alg->ahash_alg.setkey = NULL; t_alg->ahash_alg.setkey = NULL;
t_alg->is_hmac = false;
} }
alg->cra_module = THIS_MODULE; alg->cra_module = THIS_MODULE;
alg->cra_init = caam_hash_cra_init; alg->cra_init = caam_hash_cra_init;
......
...@@ -1753,6 +1753,7 @@ static struct caam_hash_template driver_hash[] = { ...@@ -1753,6 +1753,7 @@ static struct caam_hash_template driver_hash[] = {
struct caam_hash_alg { struct caam_hash_alg {
struct list_head entry; struct list_head entry;
int alg_type; int alg_type;
bool is_hmac;
struct ahash_engine_alg ahash_alg; struct ahash_engine_alg ahash_alg;
}; };
...@@ -1804,7 +1805,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) ...@@ -1804,7 +1805,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm)
} else { } else {
if (priv->era >= 6) { if (priv->era >= 6) {
ctx->dir = DMA_BIDIRECTIONAL; ctx->dir = DMA_BIDIRECTIONAL;
ctx->key_dir = alg->setkey ? DMA_TO_DEVICE : DMA_NONE; ctx->key_dir = caam_hash->is_hmac ? DMA_TO_DEVICE : DMA_NONE;
} else { } else {
ctx->dir = DMA_TO_DEVICE; ctx->dir = DMA_TO_DEVICE;
ctx->key_dir = DMA_NONE; ctx->key_dir = DMA_NONE;
...@@ -1862,7 +1863,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) ...@@ -1862,7 +1863,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm)
* For keyed hash algorithms shared descriptors * For keyed hash algorithms shared descriptors
* will be created later in setkey() callback * will be created later in setkey() callback
*/ */
return alg->setkey ? 0 : ahash_set_sh_desc(ahash); return caam_hash->is_hmac ? 0 : ahash_set_sh_desc(ahash);
} }
static void caam_hash_cra_exit(struct crypto_tfm *tfm) static void caam_hash_cra_exit(struct crypto_tfm *tfm)
...@@ -1915,12 +1916,14 @@ caam_hash_alloc(struct caam_hash_template *template, ...@@ -1915,12 +1916,14 @@ caam_hash_alloc(struct caam_hash_template *template,
template->hmac_name); template->hmac_name);
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
template->hmac_driver_name); template->hmac_driver_name);
t_alg->is_hmac = true;
} else { } else {
snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s", snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
template->name); template->name);
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
template->driver_name); template->driver_name);
halg->setkey = NULL; halg->setkey = NULL;
t_alg->is_hmac = false;
} }
alg->cra_module = THIS_MODULE; alg->cra_module = THIS_MODULE;
alg->cra_init = caam_hash_cra_init; alg->cra_init = caam_hash_cra_init;
......
...@@ -463,6 +463,7 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id) ...@@ -463,6 +463,7 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id)
hw_data->fw_name = ADF_402XX_FW; hw_data->fw_name = ADF_402XX_FW;
hw_data->fw_mmp_name = ADF_402XX_MMP; hw_data->fw_mmp_name = ADF_402XX_MMP;
hw_data->uof_get_name = uof_get_name_402xx; hw_data->uof_get_name = uof_get_name_402xx;
hw_data->get_ena_thd_mask = get_ena_thd_mask;
break; break;
case ADF_401XX_PCI_DEVICE_ID: case ADF_401XX_PCI_DEVICE_ID:
hw_data->fw_name = ADF_4XXX_FW; hw_data->fw_name = ADF_4XXX_FW;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment