[PATCH 00/30] Clean and improve SA2UL driver

Manorit Chawdhry posted 30 patches 1 week, 2 days ago
drivers/crypto/Kconfig |    1 +
drivers/crypto/sa2ul.c | 1042 +++++++++++++++++++++++++++++-------------------
drivers/crypto/sa2ul.h |  162 ++------
3 files changed, 661 insertions(+), 544 deletions(-)
[PATCH 00/30] Clean and improve SA2UL driver
Posted by Manorit Chawdhry 1 week, 2 days ago
The following series focuses on some cleanups to the sa2ul driver, it
starts with very trivial cleanups then goes to fix some bigger cleanups
and migration to crypto_engine which help fix the broader race condition
problems with the driver, thereafter it adds the support for AES CM as
per SAxUL 3.1 IP. KASAN is also run alongside to fix the issues caught
by them.

Self test results across K3 family: 
https://gist.github.com/manorit2001/544587ec3535125663e3ca9dbc186e96

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
Manorit Chawdhry (30):
      crypto: sa2ul - remove dead code
      crypto: sa2ul - remove totally unused structure fields
      crypto: sa2ul - remove unused algorithm ID fields
      crypto: sa2ul - remove unused fields from sa_cmdl_cfg
      crypto: sa2ul - remove unused fields from sa_tfm_ctx
      crypto: sa2ul - remove unused macro definitions
      crypto: sa2ul - consolidate encryption offset definitions
      crypto: sa2ul - remove unused SC ID range tracking
      crypto: sa2ul - remove unused base register pointer
      crypto: sa2ul - remove unused includes and defines
      crypto: sa2ul - remove unused line
      crypto: sa2ul - remove redundant sa_sha_digest() wrapper
      crypto: sa2ul - fix struct documentation for match_data
      crypto: sa2ul - zero out security context on free
      crypto: sa2ul - fix context release on errors
      crypto: sa2ul - fix resource leak of sha in init_alg() error path
      crypto: sa2ul - fix resource leak of AEAD in init_alg() error path
      crypto: sa2ul - fix DMA mapping leak in sa_run() error paths
      crypto: sa2ul - generate dynamic metadata length
      crypto: sa2ul - fix command label stack corruption
      crypto: sa2ul - fix error handling in sa_prepare_iopad
      crypto: sa2ul - move export to appropriate location.
      crypto: sa2ul - fix stack overflow in sa_prepare_iopads
      crypto: sa2ul - add more checks before processing ipad/opad
      crypto: sa2ul - fix data corruption by skipping device sync on unmap
      crypto: sa2ul - use correct DMA direction in sa_sync_from_device
      crypto: sa2ul - change dma_alloc_pool to mempool
      crypto: sa2ul - route requests through crypto_engine
      crypto: sa2ul - report SA engine hardware revision
      crypto: sa2ul - add AES-CM (SA3UL_CM) TRNG priming support

 drivers/crypto/Kconfig |    1 +
 drivers/crypto/sa2ul.c | 1042 +++++++++++++++++++++++++++++-------------------
 drivers/crypto/sa2ul.h |  162 ++------
 3 files changed, 661 insertions(+), 544 deletions(-)
---
base-commit: a9d7ced84989ec05be09b4b8428759ef60450a0f
change-id: 20251106-b4-upstream-sa2ul-cleanup-ce85d40c7eb8

Best regards,
--  
Manorit Chawdhry <m-chawdhry@ti.com>
Re: [PATCH 00/30] Clean and improve SA2UL driver
Posted by Herbert Xu 2 days, 2 hours ago
On Tue, Sep 15, 2026 at 03:25:06PM +0530, Manorit Chawdhry wrote:
> The following series focuses on some cleanups to the sa2ul driver, it
> starts with very trivial cleanups then goes to fix some bigger cleanups
> and migration to crypto_engine which help fix the broader race condition
> problems with the driver, thereafter it adds the support for AES CM as
> per SAxUL 3.1 IP. KASAN is also run alongside to fix the issues caught
> by them.
> 
> Self test results across K3 family: 
> https://gist.github.com/manorit2001/544587ec3535125663e3ca9dbc186e96
> 
> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
> ---
> Manorit Chawdhry (30):
>       crypto: sa2ul - remove dead code
>       crypto: sa2ul - remove totally unused structure fields
>       crypto: sa2ul - remove unused algorithm ID fields
>       crypto: sa2ul - remove unused fields from sa_cmdl_cfg
>       crypto: sa2ul - remove unused fields from sa_tfm_ctx
>       crypto: sa2ul - remove unused macro definitions
>       crypto: sa2ul - consolidate encryption offset definitions
>       crypto: sa2ul - remove unused SC ID range tracking
>       crypto: sa2ul - remove unused base register pointer
>       crypto: sa2ul - remove unused includes and defines
>       crypto: sa2ul - remove unused line
>       crypto: sa2ul - remove redundant sa_sha_digest() wrapper
>       crypto: sa2ul - fix struct documentation for match_data
>       crypto: sa2ul - zero out security context on free
>       crypto: sa2ul - fix context release on errors
>       crypto: sa2ul - fix resource leak of sha in init_alg() error path
>       crypto: sa2ul - fix resource leak of AEAD in init_alg() error path
>       crypto: sa2ul - fix DMA mapping leak in sa_run() error paths
>       crypto: sa2ul - generate dynamic metadata length
>       crypto: sa2ul - fix command label stack corruption
>       crypto: sa2ul - fix error handling in sa_prepare_iopad
>       crypto: sa2ul - move export to appropriate location.
>       crypto: sa2ul - fix stack overflow in sa_prepare_iopads
>       crypto: sa2ul - add more checks before processing ipad/opad
>       crypto: sa2ul - fix data corruption by skipping device sync on unmap
>       crypto: sa2ul - use correct DMA direction in sa_sync_from_device
>       crypto: sa2ul - change dma_alloc_pool to mempool
>       crypto: sa2ul - route requests through crypto_engine
>       crypto: sa2ul - report SA engine hardware revision
>       crypto: sa2ul - add AES-CM (SA3UL_CM) TRNG priming support
> 
>  drivers/crypto/Kconfig |    1 +
>  drivers/crypto/sa2ul.c | 1042 +++++++++++++++++++++++++++++-------------------
>  drivers/crypto/sa2ul.h |  162 ++------
>  3 files changed, 661 insertions(+), 544 deletions(-)
> ---
> base-commit: a9d7ced84989ec05be09b4b8428759ef60450a0f
> change-id: 20251106-b4-upstream-sa2ul-cleanup-ce85d40c7eb8
> 
> Best regards,
> --  
> Manorit Chawdhry <m-chawdhry@ti.com>

Please check the Sashiko comments:

https://sashiko.dev/#/patchset/20260915-b4-upstream-sa2ul-cleanup-v1-0-57ab34e97162%40ti.com

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt