[PATCH 0/4] crypto: engine - add acomp support and adapt Hisilicon HPRE and ZIP drivers
From: Chenghai Huang
Date: Mon Nov 09 2026 - 02:44:47 EST
This series adds asynchronous compression (acomp) support to the crypto
engine framework, then converts the Hisilicon HPRE and ZIP drivers to
use it instead of their hand-rolled backlog / queue-retry mechanisms.
Patch 1 fixes the retry pump loop in the engine core: it skips the
idle check that clears engine->busy and rechecks engine->running, so
after the queue drains a later request can be enqueued without a pump
and stall the engine, and crypto_engine_stop() can spin on the stale
busy flag up to -EBUSY.
Patch 2 adds struct acomp_engine_alg with transfer/finalize helpers and
a register/unregister interface, mirroring the existing akcipher and
kpp support. struct acomp_alg moves to <crypto/acompress.h> so that
engine.h can embed it.
Patch 3 gives each HPRE QP (DH/RSA/ECDH) its own crypto engine.
MAY_BACKLOG requests are routed through the engine, which provides the
backlog queue and retries on -ENOSPC; other requests are sent directly
with bounded retries, and in-flight requests are cleaned up by the
completion callback.
Patch 4 gives ZIP a per-device engine pool, with each QP context
borrowing an engine by its QP id so compression and decompression
queue independently. Requests are sent to the hardware when it has
room; on a full queue they are parked in the engine queue and retried,
with the DMA mappings kept across retries.
Chenghai Huang (3):
crypto: engine - clear busy and recheck running in the retry pump loop
crypto: engine - add acomp support
crypto: hisilicon/zip - adapt to use crypto engine
Weili Qian (1):
crypto: hisilicon/hpre - use crypto engine framework
crypto/crypto_engine.c | 46 ++-
drivers/crypto/hisilicon/Kconfig | 2 +
drivers/crypto/hisilicon/hpre/hpre.h | 4 +
drivers/crypto/hisilicon/hpre/hpre_crypto.c | 414 +++++++++++++++-----
drivers/crypto/hisilicon/zip/zip.h | 5 +
drivers/crypto/hisilicon/zip/zip_crypto.c | 358 +++++++++++------
include/crypto/acompress.h | 33 ++
include/crypto/engine.h | 13 +
include/crypto/internal/acompress.h | 33 --
9 files changed, 649 insertions(+), 259 deletions(-)
--
2.43.0