Import of kernel-6.12.0-211.29.1.el10_2
This commit is contained in:
parent
c259bc25aa
commit
14b9dd0a25
@ -532,7 +532,7 @@ static struct tegra_se_alg tegra_aes_algs[] = {
|
||||
.cra_name = "cbc(aes)",
|
||||
.cra_driver_name = "cbc-aes-tegra",
|
||||
.cra_priority = 500,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | CRYPTO_ALG_ASYNC,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = AES_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_aes_ctx),
|
||||
.cra_alignmask = 0xf,
|
||||
@ -553,7 +553,7 @@ static struct tegra_se_alg tegra_aes_algs[] = {
|
||||
.cra_name = "ecb(aes)",
|
||||
.cra_driver_name = "ecb-aes-tegra",
|
||||
.cra_priority = 500,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | CRYPTO_ALG_ASYNC,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = AES_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_aes_ctx),
|
||||
.cra_alignmask = 0xf,
|
||||
@ -575,7 +575,7 @@ static struct tegra_se_alg tegra_aes_algs[] = {
|
||||
.cra_name = "ctr(aes)",
|
||||
.cra_driver_name = "ctr-aes-tegra",
|
||||
.cra_priority = 500,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | CRYPTO_ALG_ASYNC,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = 1,
|
||||
.cra_ctxsize = sizeof(struct tegra_aes_ctx),
|
||||
.cra_alignmask = 0xf,
|
||||
@ -597,6 +597,7 @@ static struct tegra_se_alg tegra_aes_algs[] = {
|
||||
.cra_name = "xts(aes)",
|
||||
.cra_driver_name = "xts-aes-tegra",
|
||||
.cra_priority = 500,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = AES_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_aes_ctx),
|
||||
.cra_alignmask = (__alignof__(u64) - 1),
|
||||
@ -1200,6 +1201,7 @@ static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq)
|
||||
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
|
||||
struct tegra_aead_ctx *ctx = crypto_aead_ctx(tfm);
|
||||
struct tegra_se *se = ctx->se;
|
||||
unsigned int bufsize;
|
||||
int ret;
|
||||
|
||||
ret = tegra_ccm_crypt_init(req, se, rctx);
|
||||
@ -1209,19 +1211,19 @@ static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq)
|
||||
rctx->key_id = ctx->key_id;
|
||||
|
||||
/* Allocate buffers required */
|
||||
rctx->inbuf.size = rctx->assoclen + rctx->authsize + rctx->cryptlen + 100;
|
||||
rctx->inbuf.buf = dma_alloc_coherent(ctx->se->dev, rctx->inbuf.size,
|
||||
bufsize = rctx->assoclen + rctx->authsize + rctx->cryptlen + 100;
|
||||
rctx->inbuf.size = bufsize;
|
||||
rctx->inbuf.buf = dma_alloc_coherent(ctx->se->dev, bufsize,
|
||||
&rctx->inbuf.addr, GFP_KERNEL);
|
||||
ret = -ENOMEM;
|
||||
if (!rctx->inbuf.buf)
|
||||
goto out_finalize;
|
||||
|
||||
rctx->outbuf.size = rctx->assoclen + rctx->authsize + rctx->cryptlen + 100;
|
||||
rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, rctx->outbuf.size,
|
||||
rctx->outbuf.size = bufsize;
|
||||
rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, bufsize,
|
||||
&rctx->outbuf.addr, GFP_KERNEL);
|
||||
if (!rctx->outbuf.buf) {
|
||||
ret = -ENOMEM;
|
||||
if (!rctx->outbuf.buf)
|
||||
goto out_free_inbuf;
|
||||
}
|
||||
|
||||
if (!ctx->key_id) {
|
||||
ret = tegra_key_submit_reserved_aes(ctx->se, ctx->key,
|
||||
@ -1253,11 +1255,11 @@ static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq)
|
||||
}
|
||||
|
||||
out:
|
||||
dma_free_coherent(ctx->se->dev, rctx->inbuf.size,
|
||||
dma_free_coherent(ctx->se->dev, bufsize,
|
||||
rctx->outbuf.buf, rctx->outbuf.addr);
|
||||
|
||||
out_free_inbuf:
|
||||
dma_free_coherent(ctx->se->dev, rctx->outbuf.size,
|
||||
dma_free_coherent(ctx->se->dev, bufsize,
|
||||
rctx->inbuf.buf, rctx->inbuf.addr);
|
||||
|
||||
if (tegra_key_is_reserved(rctx->key_id))
|
||||
@ -1277,6 +1279,7 @@ static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
|
||||
struct crypto_aead *tfm = crypto_aead_reqtfm(req);
|
||||
struct tegra_aead_ctx *ctx = crypto_aead_ctx(tfm);
|
||||
struct tegra_aead_reqctx *rctx = aead_request_ctx(req);
|
||||
unsigned int bufsize;
|
||||
int ret;
|
||||
|
||||
rctx->src_sg = req->src;
|
||||
@ -1295,16 +1298,17 @@ static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
|
||||
rctx->key_id = ctx->key_id;
|
||||
|
||||
/* Allocate buffers required */
|
||||
rctx->inbuf.size = rctx->assoclen + rctx->authsize + rctx->cryptlen;
|
||||
rctx->inbuf.buf = dma_alloc_coherent(ctx->se->dev, rctx->inbuf.size,
|
||||
bufsize = rctx->assoclen + rctx->authsize + rctx->cryptlen;
|
||||
rctx->inbuf.size = bufsize;
|
||||
rctx->inbuf.buf = dma_alloc_coherent(ctx->se->dev, bufsize,
|
||||
&rctx->inbuf.addr, GFP_KERNEL);
|
||||
if (!rctx->inbuf.buf) {
|
||||
ret = -ENOMEM;
|
||||
goto out_finalize;
|
||||
}
|
||||
|
||||
rctx->outbuf.size = rctx->assoclen + rctx->authsize + rctx->cryptlen;
|
||||
rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, rctx->outbuf.size,
|
||||
rctx->outbuf.size = bufsize;
|
||||
rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, bufsize,
|
||||
&rctx->outbuf.addr, GFP_KERNEL);
|
||||
if (!rctx->outbuf.buf) {
|
||||
ret = -ENOMEM;
|
||||
@ -1341,11 +1345,11 @@ static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
|
||||
ret = tegra_gcm_do_verify(ctx->se, rctx);
|
||||
|
||||
out:
|
||||
dma_free_coherent(ctx->se->dev, rctx->outbuf.size,
|
||||
dma_free_coherent(ctx->se->dev, bufsize,
|
||||
rctx->outbuf.buf, rctx->outbuf.addr);
|
||||
|
||||
out_free_inbuf:
|
||||
dma_free_coherent(ctx->se->dev, rctx->inbuf.size,
|
||||
dma_free_coherent(ctx->se->dev, bufsize,
|
||||
rctx->inbuf.buf, rctx->inbuf.addr);
|
||||
|
||||
if (tegra_key_is_reserved(rctx->key_id))
|
||||
@ -1931,6 +1935,7 @@ static struct tegra_se_alg tegra_aead_algs[] = {
|
||||
.cra_name = "gcm(aes)",
|
||||
.cra_driver_name = "gcm-aes-tegra",
|
||||
.cra_priority = 500,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = 1,
|
||||
.cra_ctxsize = sizeof(struct tegra_aead_ctx),
|
||||
.cra_alignmask = 0xf,
|
||||
@ -1953,6 +1958,7 @@ static struct tegra_se_alg tegra_aead_algs[] = {
|
||||
.cra_name = "ccm(aes)",
|
||||
.cra_driver_name = "ccm-aes-tegra",
|
||||
.cra_priority = 500,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = 1,
|
||||
.cra_ctxsize = sizeof(struct tegra_aead_ctx),
|
||||
.cra_alignmask = 0xf,
|
||||
@ -1980,7 +1986,7 @@ static struct tegra_se_alg tegra_cmac_algs[] = {
|
||||
.cra_name = "cmac(aes)",
|
||||
.cra_driver_name = "tegra-se-cmac",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = AES_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_cmac_ctx),
|
||||
.cra_alignmask = 0,
|
||||
|
||||
@ -118,8 +118,9 @@ static int tegra_sha_fallback_init(struct ahash_request *req)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||
|
||||
ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback_tfm);
|
||||
rctx->fallback_req.base.flags = req->base.flags &
|
||||
CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
ahash_request_set_callback(&rctx->fallback_req,
|
||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
req->base.complete, req->base.data);
|
||||
|
||||
return crypto_ahash_init(&rctx->fallback_req);
|
||||
}
|
||||
@ -131,10 +132,10 @@ static int tegra_sha_fallback_update(struct ahash_request *req)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||
|
||||
ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback_tfm);
|
||||
rctx->fallback_req.base.flags = req->base.flags &
|
||||
CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
rctx->fallback_req.nbytes = req->nbytes;
|
||||
rctx->fallback_req.src = req->src;
|
||||
ahash_request_set_callback(&rctx->fallback_req,
|
||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
req->base.complete, req->base.data);
|
||||
ahash_request_set_crypt(&rctx->fallback_req, req->src, NULL, req->nbytes);
|
||||
|
||||
return crypto_ahash_update(&rctx->fallback_req);
|
||||
}
|
||||
@ -146,9 +147,10 @@ static int tegra_sha_fallback_final(struct ahash_request *req)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||
|
||||
ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback_tfm);
|
||||
rctx->fallback_req.base.flags = req->base.flags &
|
||||
CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
rctx->fallback_req.result = req->result;
|
||||
ahash_request_set_callback(&rctx->fallback_req,
|
||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
req->base.complete, req->base.data);
|
||||
ahash_request_set_crypt(&rctx->fallback_req, NULL, req->result, 0);
|
||||
|
||||
return crypto_ahash_final(&rctx->fallback_req);
|
||||
}
|
||||
@ -160,12 +162,11 @@ static int tegra_sha_fallback_finup(struct ahash_request *req)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||
|
||||
ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback_tfm);
|
||||
rctx->fallback_req.base.flags = req->base.flags &
|
||||
CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
|
||||
rctx->fallback_req.nbytes = req->nbytes;
|
||||
rctx->fallback_req.src = req->src;
|
||||
rctx->fallback_req.result = req->result;
|
||||
ahash_request_set_callback(&rctx->fallback_req,
|
||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
req->base.complete, req->base.data);
|
||||
ahash_request_set_crypt(&rctx->fallback_req, req->src, req->result,
|
||||
req->nbytes);
|
||||
|
||||
return crypto_ahash_finup(&rctx->fallback_req);
|
||||
}
|
||||
@ -177,12 +178,11 @@ static int tegra_sha_fallback_digest(struct ahash_request *req)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||
|
||||
ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback_tfm);
|
||||
rctx->fallback_req.base.flags = req->base.flags &
|
||||
CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
|
||||
rctx->fallback_req.nbytes = req->nbytes;
|
||||
rctx->fallback_req.src = req->src;
|
||||
rctx->fallback_req.result = req->result;
|
||||
ahash_request_set_callback(&rctx->fallback_req,
|
||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
req->base.complete, req->base.data);
|
||||
ahash_request_set_crypt(&rctx->fallback_req, req->src, req->result,
|
||||
req->nbytes);
|
||||
|
||||
return crypto_ahash_digest(&rctx->fallback_req);
|
||||
}
|
||||
@ -194,8 +194,9 @@ static int tegra_sha_fallback_import(struct ahash_request *req, const void *in)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||
|
||||
ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback_tfm);
|
||||
rctx->fallback_req.base.flags = req->base.flags &
|
||||
CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
ahash_request_set_callback(&rctx->fallback_req,
|
||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
req->base.complete, req->base.data);
|
||||
|
||||
return crypto_ahash_import(&rctx->fallback_req, in);
|
||||
}
|
||||
@ -207,8 +208,9 @@ static int tegra_sha_fallback_export(struct ahash_request *req, void *out)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
|
||||
|
||||
ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback_tfm);
|
||||
rctx->fallback_req.base.flags = req->base.flags &
|
||||
CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
ahash_request_set_callback(&rctx->fallback_req,
|
||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
req->base.complete, req->base.data);
|
||||
|
||||
return crypto_ahash_export(&rctx->fallback_req, out);
|
||||
}
|
||||
@ -399,8 +401,9 @@ static int tegra_sha_do_update(struct ahash_request *req)
|
||||
struct tegra_sha_ctx *ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req));
|
||||
struct tegra_sha_reqctx *rctx = ahash_request_ctx(req);
|
||||
struct tegra_se *se = ctx->se;
|
||||
unsigned int nblks, nresidue, size, ret;
|
||||
unsigned int nblks, nresidue, size;
|
||||
u32 *cpuvaddr = se->cmdbuf->addr;
|
||||
int ret;
|
||||
|
||||
nresidue = (req->nbytes + rctx->residue.size) % rctx->blk_size;
|
||||
nblks = (req->nbytes + rctx->residue.size) / rctx->blk_size;
|
||||
@ -761,7 +764,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha1",
|
||||
.cra_driver_name = "tegra-se-sha1",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA1_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -786,7 +789,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha224",
|
||||
.cra_driver_name = "tegra-se-sha224",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA224_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -811,7 +814,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha256",
|
||||
.cra_driver_name = "tegra-se-sha256",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA256_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -836,7 +839,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha384",
|
||||
.cra_driver_name = "tegra-se-sha384",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA384_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -861,7 +864,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha512",
|
||||
.cra_driver_name = "tegra-se-sha512",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA512_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -886,7 +889,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha3-224",
|
||||
.cra_driver_name = "tegra-se-sha3-224",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA3_224_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -911,7 +914,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha3-256",
|
||||
.cra_driver_name = "tegra-se-sha3-256",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA3_256_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -936,7 +939,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha3-384",
|
||||
.cra_driver_name = "tegra-se-sha3-384",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA3_384_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -961,7 +964,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "sha3-512",
|
||||
.cra_driver_name = "tegra-se-sha3-512",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC,
|
||||
.cra_blocksize = SHA3_512_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -988,7 +991,8 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "hmac(sha224)",
|
||||
.cra_driver_name = "tegra-se-hmac-sha224",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA224_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -1015,7 +1019,8 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "hmac(sha256)",
|
||||
.cra_driver_name = "tegra-se-hmac-sha256",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA256_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -1042,7 +1047,8 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "hmac(sha384)",
|
||||
.cra_driver_name = "tegra-se-hmac-sha384",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA384_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
@ -1069,7 +1075,8 @@ static struct tegra_se_alg tegra_hash_algs[] = {
|
||||
.cra_name = "hmac(sha512)",
|
||||
.cra_driver_name = "tegra-se-hmac-sha512",
|
||||
.cra_priority = 300,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_blocksize = SHA512_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tegra_sha_ctx),
|
||||
.cra_alignmask = 0,
|
||||
|
||||
@ -52,7 +52,7 @@ tegra_se_cmdbuf_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_dire
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
kref_init(&map->ref);
|
||||
map->bo = host1x_bo_get(bo);
|
||||
map->bo = bo;
|
||||
map->direction = direction;
|
||||
map->dev = dev;
|
||||
|
||||
@ -93,7 +93,6 @@ static void tegra_se_cmdbuf_unpin(struct host1x_bo_mapping *map)
|
||||
dma_unmap_sgtable(map->dev, map->sgt, map->direction, 0);
|
||||
sg_free_table(map->sgt);
|
||||
kfree(map->sgt);
|
||||
host1x_bo_put(map->bo);
|
||||
|
||||
kfree(map);
|
||||
}
|
||||
@ -310,7 +309,7 @@ static int tegra_se_probe(struct platform_device *pdev)
|
||||
|
||||
se->engine = crypto_engine_alloc_init(dev, 0);
|
||||
if (!se->engine)
|
||||
return dev_err_probe(dev, -ENOMEM, "failed to init crypto engine\n");
|
||||
return -ENOMEM;
|
||||
|
||||
ret = crypto_engine_start(se->engine);
|
||||
if (ret) {
|
||||
@ -320,7 +319,6 @@ static int tegra_se_probe(struct platform_device *pdev)
|
||||
|
||||
ret = tegra_se_host1x_register(se);
|
||||
if (ret) {
|
||||
crypto_engine_stop(se->engine);
|
||||
crypto_engine_exit(se->engine);
|
||||
return dev_err_probe(dev, ret, "failed to init host1x params\n");
|
||||
}
|
||||
@ -332,7 +330,6 @@ static void tegra_se_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_se *se = platform_get_drvdata(pdev);
|
||||
|
||||
crypto_engine_stop(se->engine);
|
||||
crypto_engine_exit(se->engine);
|
||||
host1x_client_unregister(&se->client);
|
||||
}
|
||||
|
||||
@ -3121,6 +3121,7 @@ int mlx5_ib_dev_res_srq_init(struct mlx5_ib_dev *dev)
|
||||
"Couldn't create SRQ 1 for res init, err=%pe\n",
|
||||
s1);
|
||||
ib_destroy_srq(s0);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
devr->s0 = s0;
|
||||
|
||||
@ -350,7 +350,7 @@ int pvrdma_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)
|
||||
uresp.qp_tab_size = vdev->dsr->caps.max_qp;
|
||||
ret = ib_copy_to_udata(udata, &uresp, sizeof(uresp));
|
||||
if (ret) {
|
||||
pvrdma_uar_free(vdev, &context->uar);
|
||||
/* pvrdma_dealloc_ucontext() also frees the UAR */
|
||||
pvrdma_dealloc_ucontext(&context->ibucontext);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@ -1638,7 +1638,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr,
|
||||
{
|
||||
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
|
||||
int rval = QLA_FUNCTION_FAILED;
|
||||
uint16_t state[6];
|
||||
uint16_t state[16];
|
||||
uint32_t pstate;
|
||||
|
||||
if (IS_QLAFX00(vha->hw)) {
|
||||
@ -2402,6 +2402,63 @@ qla2x00_dport_diagnostics_show(struct device *dev,
|
||||
vha->dport_data[0], vha->dport_data[1],
|
||||
vha->dport_data[2], vha->dport_data[3]);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
qla2x00_mpi_fw_state_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
|
||||
int rval = QLA_FUNCTION_FAILED;
|
||||
u16 state[16];
|
||||
u16 mpi_state;
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
|
||||
if (!(IS_QLA27XX(ha) || IS_QLA28XX(ha)))
|
||||
return scnprintf(buf, PAGE_SIZE,
|
||||
"MPI state reporting is not supported for this HBA.\n");
|
||||
|
||||
memset(state, 0, sizeof(state));
|
||||
|
||||
mutex_lock(&vha->hw->optrom_mutex);
|
||||
if (qla2x00_chip_is_down(vha)) {
|
||||
mutex_unlock(&vha->hw->optrom_mutex);
|
||||
ql_dbg(ql_dbg_user, vha, 0x70df,
|
||||
"ISP reset is in progress, failing mpi_fw_state.\n");
|
||||
return -EBUSY;
|
||||
} else if (vha->hw->flags.eeh_busy) {
|
||||
mutex_unlock(&vha->hw->optrom_mutex);
|
||||
ql_dbg(ql_dbg_user, vha, 0x70ea,
|
||||
"HBA in PCI error state, failing mpi_fw_state.\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
rval = qla2x00_get_firmware_state(vha, state);
|
||||
mutex_unlock(&vha->hw->optrom_mutex);
|
||||
if (rval != QLA_SUCCESS) {
|
||||
ql_dbg(ql_dbg_user, vha, 0x70eb,
|
||||
"MB Command to retrieve MPI state failed (%d), failing mpi_fw_state.\n",
|
||||
rval);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
mpi_state = state[11];
|
||||
|
||||
if (!(mpi_state & BIT_15))
|
||||
return scnprintf(buf, PAGE_SIZE,
|
||||
"MPI firmware state reporting is not supported by this firmware. (0x%02x)\n",
|
||||
mpi_state);
|
||||
|
||||
if (!(mpi_state & BIT_8))
|
||||
return scnprintf(buf, PAGE_SIZE,
|
||||
"MPI firmware is disabled. (0x%02x)\n",
|
||||
mpi_state);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE,
|
||||
"MPI firmware is enabled, state is %s. (0x%02x)\n",
|
||||
mpi_state & BIT_9 ? "active" : "inactive",
|
||||
mpi_state);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(dport_diagnostics, 0444,
|
||||
qla2x00_dport_diagnostics_show, NULL);
|
||||
|
||||
@ -2469,6 +2526,8 @@ static DEVICE_ATTR(port_speed, 0644, qla2x00_port_speed_show,
|
||||
qla2x00_port_speed_store);
|
||||
static DEVICE_ATTR(port_no, 0444, qla2x00_port_no_show, NULL);
|
||||
static DEVICE_ATTR(fw_attr, 0444, qla2x00_fw_attr_show, NULL);
|
||||
static DEVICE_ATTR(mpi_fw_state, 0444, qla2x00_mpi_fw_state_show, NULL);
|
||||
|
||||
|
||||
static struct attribute *qla2x00_host_attrs[] = {
|
||||
&dev_attr_driver_version.attr.attr,
|
||||
@ -2517,6 +2576,7 @@ static struct attribute *qla2x00_host_attrs[] = {
|
||||
&dev_attr_qlini_mode.attr,
|
||||
&dev_attr_ql2xiniexchg.attr,
|
||||
&dev_attr_ql2xexchoffld.attr,
|
||||
&dev_attr_mpi_fw_state.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
@ -4916,7 +4916,7 @@ qla2x00_fw_ready(scsi_qla_host_t *vha)
|
||||
unsigned long wtime, mtime, cs84xx_time;
|
||||
uint16_t min_wait; /* Minimum wait time if loop is down */
|
||||
uint16_t wait_time; /* Wait time if loop is coming ready */
|
||||
uint16_t state[6];
|
||||
uint16_t state[16];
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
|
||||
if (IS_QLAFX00(vha->hw))
|
||||
|
||||
@ -2266,6 +2266,13 @@ qla2x00_get_firmware_state(scsi_qla_host_t *vha, uint16_t *states)
|
||||
mcp->in_mb = MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
|
||||
else
|
||||
mcp->in_mb = MBX_1|MBX_0;
|
||||
|
||||
if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
|
||||
mcp->mb[12] = 0;
|
||||
mcp->out_mb |= MBX_12;
|
||||
mcp->in_mb |= MBX_12;
|
||||
}
|
||||
|
||||
mcp->tov = MBX_TOV_SECONDS;
|
||||
mcp->flags = 0;
|
||||
rval = qla2x00_mailbox_command(vha, mcp);
|
||||
@ -2278,6 +2285,8 @@ qla2x00_get_firmware_state(scsi_qla_host_t *vha, uint16_t *states)
|
||||
states[3] = mcp->mb[4];
|
||||
states[4] = mcp->mb[5];
|
||||
states[5] = mcp->mb[6]; /* DPORT status */
|
||||
if (IS_QLA27XX(ha) || IS_QLA28XX(ha))
|
||||
states[11] = mcp->mb[12]; /* MPI state. */
|
||||
}
|
||||
|
||||
if (rval != QLA_SUCCESS) {
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
|
||||
kernel.almalinux,1,AlmaLinux,kernel-core,6.12.0-211.28.1.el10.x86_64,mailto:security@almalinux.org
|
||||
kernel.almalinux,1,AlmaLinux,kernel-core,6.12.0-211.29.1.el10.x86_64,mailto:security@almalinux.org
|
||||
|
||||
@ -1123,8 +1123,8 @@ alloc_new_skb:
|
||||
!(rt->dst.dev->features & NETIF_F_SG)))
|
||||
alloclen = fraglen;
|
||||
else {
|
||||
alloclen = fragheaderlen + transhdrlen;
|
||||
pagedlen = datalen - transhdrlen;
|
||||
alloclen = fragheaderlen + transhdrlen + fraggap;
|
||||
pagedlen = datalen - transhdrlen - fraggap;
|
||||
}
|
||||
|
||||
alloclen += alloc_extra;
|
||||
@ -1171,9 +1171,6 @@ alloc_new_skb:
|
||||
}
|
||||
|
||||
copy = datalen - transhdrlen - fraggap - pagedlen;
|
||||
/* [!] NOTE: copy will be negative if pagedlen>0
|
||||
* because then the equation reduces to -fraggap.
|
||||
*/
|
||||
if (copy > 0 && getfrag(from, data + transhdrlen, offset, copy, fraggap, skb) < 0) {
|
||||
err = -EFAULT;
|
||||
kfree_skb(skb);
|
||||
|
||||
@ -1642,8 +1642,8 @@ alloc_new_skb:
|
||||
!(rt->dst.dev->features & NETIF_F_SG)))
|
||||
alloclen = fraglen;
|
||||
else {
|
||||
alloclen = fragheaderlen + transhdrlen;
|
||||
pagedlen = datalen - transhdrlen;
|
||||
alloclen = fragheaderlen + transhdrlen + fraggap;
|
||||
pagedlen = datalen - transhdrlen - fraggap;
|
||||
}
|
||||
alloclen += alloc_extra;
|
||||
|
||||
@ -1658,10 +1658,7 @@ alloc_new_skb:
|
||||
fraglen = datalen + fragheaderlen;
|
||||
|
||||
copy = datalen - transhdrlen - fraggap - pagedlen;
|
||||
/* [!] NOTE: copy may be negative if pagedlen>0
|
||||
* because then the equation may reduces to -fraggap.
|
||||
*/
|
||||
if (copy < 0 && !(flags & MSG_SPLICE_PAGES)) {
|
||||
if (copy < 0) {
|
||||
err = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -99,6 +99,9 @@ struct loopback_ops {
|
||||
struct loopback_cable {
|
||||
spinlock_t lock;
|
||||
struct loopback_pcm *streams[2];
|
||||
/* in-flight peer stops running outside cable->lock */
|
||||
atomic_t stop_count;
|
||||
wait_queue_head_t stop_wait;
|
||||
struct snd_pcm_hardware hw;
|
||||
/* flags */
|
||||
unsigned int valid;
|
||||
@ -366,8 +369,11 @@ static int loopback_check_format(struct loopback_cable *cable, int stream)
|
||||
return 0;
|
||||
if (stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
return -EIO;
|
||||
else if (cruntime->state == SNDRV_PCM_STATE_RUNNING)
|
||||
else if (cruntime->state == SNDRV_PCM_STATE_RUNNING) {
|
||||
/* close must not free the peer runtime below */
|
||||
atomic_inc(&cable->stop_count);
|
||||
stop_capture = true;
|
||||
}
|
||||
}
|
||||
|
||||
setup = get_setup(dpcm_play);
|
||||
@ -396,8 +402,11 @@ static int loopback_check_format(struct loopback_cable *cable, int stream)
|
||||
}
|
||||
}
|
||||
|
||||
if (stop_capture)
|
||||
if (stop_capture) {
|
||||
snd_pcm_stop(dpcm_capt->substream, SNDRV_PCM_STATE_DRAINING);
|
||||
if (atomic_dec_and_test(&cable->stop_count))
|
||||
wake_up(&cable->stop_wait);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1049,23 +1058,29 @@ static void free_cable(struct snd_pcm_substream *substream)
|
||||
struct loopback *loopback = substream->private_data;
|
||||
int dev = get_cable_index(substream);
|
||||
struct loopback_cable *cable;
|
||||
struct loopback_pcm *dpcm;
|
||||
bool other_alive;
|
||||
|
||||
cable = loopback->cables[substream->number][dev];
|
||||
if (!cable)
|
||||
return;
|
||||
if (cable->streams[!substream->stream]) {
|
||||
/* other stream is still alive */
|
||||
guard(spinlock_irq)(&cable->lock);
|
||||
cable->streams[substream->stream] = NULL;
|
||||
} else {
|
||||
struct loopback_pcm *dpcm = substream->runtime->private_data;
|
||||
|
||||
if (cable->ops && cable->ops->close_cable && dpcm)
|
||||
cable->ops->close_cable(dpcm);
|
||||
/* free the cable */
|
||||
loopback->cables[substream->number][dev] = NULL;
|
||||
kfree(cable);
|
||||
scoped_guard(spinlock_irq, &cable->lock) {
|
||||
cable->streams[substream->stream] = NULL;
|
||||
other_alive = cable->streams[!substream->stream];
|
||||
}
|
||||
|
||||
/* Pair with the stop_count increment in loopback_check_format(). */
|
||||
wait_event(cable->stop_wait, !atomic_read(&cable->stop_count));
|
||||
if (other_alive)
|
||||
return;
|
||||
|
||||
dpcm = substream->runtime->private_data;
|
||||
if (cable->ops && cable->ops->close_cable && dpcm)
|
||||
cable->ops->close_cable(dpcm);
|
||||
/* free the cable */
|
||||
loopback->cables[substream->number][dev] = NULL;
|
||||
kfree(cable);
|
||||
}
|
||||
|
||||
static int loopback_jiffies_timer_open(struct loopback_pcm *dpcm)
|
||||
@ -1260,6 +1275,8 @@ static int loopback_open(struct snd_pcm_substream *substream)
|
||||
goto unlock;
|
||||
}
|
||||
spin_lock_init(&cable->lock);
|
||||
atomic_set(&cable->stop_count, 0);
|
||||
init_waitqueue_head(&cable->stop_wait);
|
||||
cable->hw = loopback_pcm_hardware;
|
||||
if (loopback->timer_source)
|
||||
cable->ops = &loopback_snd_timer_ops;
|
||||
|
||||
@ -275,8 +275,8 @@ static inline bool has_tx_length_quirk(struct snd_usb_audio *chip)
|
||||
return chip->quirk_flags & QUIRK_FLAG_TX_LENGTH;
|
||||
}
|
||||
|
||||
static void prepare_silent_urb(struct snd_usb_endpoint *ep,
|
||||
struct snd_urb_ctx *ctx)
|
||||
static int prepare_silent_urb(struct snd_usb_endpoint *ep,
|
||||
struct snd_urb_ctx *ctx)
|
||||
{
|
||||
struct urb *urb = ctx->urb;
|
||||
unsigned int offs = 0;
|
||||
@ -289,28 +289,34 @@ static void prepare_silent_urb(struct snd_usb_endpoint *ep,
|
||||
extra = sizeof(packet_length);
|
||||
|
||||
for (i = 0; i < ctx->packets; ++i) {
|
||||
unsigned int offset;
|
||||
unsigned int length;
|
||||
int counts;
|
||||
int length;
|
||||
|
||||
counts = snd_usb_endpoint_next_packet_size(ep, ctx, i, 0);
|
||||
length = counts * ep->stride; /* number of silent bytes */
|
||||
offset = offs * ep->stride + extra * i;
|
||||
urb->iso_frame_desc[i].offset = offset;
|
||||
length = snd_usb_endpoint_next_packet_size(ep, ctx, i, 0);
|
||||
if (length < 0)
|
||||
return length;
|
||||
length *= ep->stride; /* number of silent bytes */
|
||||
if (offs + length + extra > ctx->buffer_size)
|
||||
break;
|
||||
urb->iso_frame_desc[i].offset = offs;
|
||||
urb->iso_frame_desc[i].length = length + extra;
|
||||
if (extra) {
|
||||
packet_length = cpu_to_le32(length);
|
||||
memcpy(urb->transfer_buffer + offset,
|
||||
memcpy(urb->transfer_buffer + offs,
|
||||
&packet_length, sizeof(packet_length));
|
||||
offs += extra;
|
||||
}
|
||||
memset(urb->transfer_buffer + offset + extra,
|
||||
memset(urb->transfer_buffer + offs,
|
||||
ep->silence_value, length);
|
||||
offs += counts;
|
||||
offs += length;
|
||||
}
|
||||
|
||||
urb->number_of_packets = ctx->packets;
|
||||
urb->transfer_buffer_length = offs * ep->stride + ctx->packets * extra;
|
||||
if (!offs)
|
||||
return -EPIPE;
|
||||
|
||||
urb->number_of_packets = i;
|
||||
urb->transfer_buffer_length = offs;
|
||||
ctx->queued = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -332,8 +338,7 @@ static int prepare_outbound_urb(struct snd_usb_endpoint *ep,
|
||||
if (data_subs && ep->prepare_data_urb)
|
||||
return ep->prepare_data_urb(data_subs, urb, in_stream_lock);
|
||||
/* no data provider, so send silence */
|
||||
prepare_silent_urb(ep, ctx);
|
||||
break;
|
||||
return prepare_silent_urb(ep, ctx);
|
||||
|
||||
case SND_USB_ENDPOINT_TYPE_SYNC:
|
||||
if (snd_usb_get_speed(ep->chip->dev) >= USB_SPEED_HIGH) {
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
|
||||
kernel-uki-virt-addons.almalinux,1,AlmaLinux,kernel-uki-virt-addons,6.12.0-211.28.1.el10.x86_64,mailto:security@almalinux.org
|
||||
kernel-uki-virt-addons.almalinux,1,AlmaLinux,kernel-uki-virt-addons,6.12.0-211.29.1.el10.x86_64,mailto:security@almalinux.org
|
||||
|
||||
2
uki.sbat
2
uki.sbat
@ -1,2 +1,2 @@
|
||||
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
|
||||
kernel-uki-virt.almalinux,1,AlmaLinux,kernel-uki-virt,6.12.0-211.28.1.el10.x86_64,mailto:security@almalinux.org
|
||||
kernel-uki-virt.almalinux,1,AlmaLinux,kernel-uki-virt,6.12.0-211.29.1.el10.x86_64,mailto:security@almalinux.org
|
||||
|
||||
Loading…
Reference in New Issue
Block a user