[PATCH 1/4] crypto: iaa - carry the iaa_wq in the request
From: Vinicius Costa Gomes
Date: Mon Oct 19 2026 - 19:07:16 EST
The submit helpers and the completion look the iaa_wq up again through
the WQ's private pointer, after the entry point has already found it to
take its reference. The submit helpers are also passed the WQ
separately, so a request has no single record of which WQ it holds its
reference on.
Store the iaa_wq in the request context when the reference is taken, and
use it everywhere after that. This makes the association of a
IAA workqueue and the request clear.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx>
---
drivers/crypto/intel/iaa/iaa_crypto_main.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c
index c9ab4b83ae02..0f5bd244b00a 100644
--- a/drivers/crypto/intel/iaa/iaa_crypto_main.c
+++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c
@@ -159,6 +159,7 @@ static bool async_mode;
static bool use_irq;
struct iaa_req_ctx {
+ struct iaa_wq *iaa_wq;
u32 compression_crc;
struct page *bounce_src;
dma_addr_t bounce_src_dma;
@@ -1070,7 +1071,7 @@ static void iaa_desc_complete(struct idxd_desc *idxd_desc,
compression_ctx = crypto_tfm_ctx(ctx->tfm);
- iaa_wq = idxd_wq_get_private(idxd_desc->wq);
+ iaa_wq = req_ctx->iaa_wq;
iaa_device = iaa_wq->iaa_device;
idxd = iaa_device->idxd;
pdev = idxd->pdev;
@@ -1177,7 +1178,7 @@ static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,
struct device *dev;
int ret = 0;
- iaa_wq = idxd_wq_get_private(wq);
+ iaa_wq = req_ctx->iaa_wq;
iaa_device = iaa_wq->iaa_device;
idxd = iaa_device->idxd;
pdev = idxd->pdev;
@@ -1328,7 +1329,7 @@ static int iaa_compress_verify(struct crypto_tfm *tfm, struct acomp_req *req,
struct device *dev;
int ret = 0;
- iaa_wq = idxd_wq_get_private(wq);
+ iaa_wq = req_ctx->iaa_wq;
iaa_device = iaa_wq->iaa_device;
idxd = iaa_device->idxd;
pdev = idxd->pdev;
@@ -1405,6 +1406,7 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req,
{
struct iaa_device_compression_mode *active_compression_mode;
struct iaa_compression_ctx *ctx = crypto_tfm_ctx(tfm);
+ struct iaa_req_ctx *req_ctx = acomp_request_ctx(req);
struct iaa_device *iaa_device;
struct idxd_desc *idxd_desc;
struct iax_hw_desc *desc;
@@ -1414,7 +1416,7 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req,
struct device *dev;
int ret = 0;
- iaa_wq = idxd_wq_get_private(wq);
+ iaa_wq = req_ctx->iaa_wq;
iaa_device = iaa_wq->iaa_device;
idxd = iaa_device->idxd;
pdev = idxd->pdev;
@@ -1555,6 +1557,7 @@ static int iaa_comp_acompress(struct acomp_req *req)
}
iaa_wq = idxd_wq_get_private(wq);
+ req_ctx->iaa_wq = iaa_wq;
dev = &wq->idxd->pdev->dev;
@@ -1664,6 +1667,7 @@ static int iaa_comp_adecompress(struct acomp_req *req)
}
iaa_wq = idxd_wq_get_private(wq);
+ req_ctx->iaa_wq = iaa_wq;
dev = &wq->idxd->pdev->dev;
--
2.56.0