[PATCH v2 00/12] crypto: talitos - fix several issues in the Freescale talitos crypto driver

Paul Louvel posted 12 patches 1 month, 1 week ago
There is a newer version of this series
drivers/crypto/talitos.c | 578 ++++++++++++++++++++++++-----------------------
drivers/crypto/talitos.h |  14 ++
2 files changed, 315 insertions(+), 277 deletions(-)
[PATCH v2 00/12] crypto: talitos - fix several issues in the Freescale talitos crypto driver
Posted by Paul Louvel 1 month, 1 week ago
This series fixes several issues in the Freescale talitos crypto driver.

Patch 1 fixes a missing dma_sync_single_for_cpu() before reading a
descriptor header.

Patches 2-5 add support for chaining an arbitrary number of descriptors
in the driver for the SEC1 hardware.

Patches 6-9 rework the SEC1 hash implementation to build descriptor
chains instead of submitting one descriptor at a time via a workqueue.

Patch 10 fixes the same ahash request size limitation on SEC2 (64k - 1
bytes), by splitting ahash_done() into SEC1 and SEC2 paths so that SEC2
iterates through descriptors sequentially.

Patch 11 fixes an off-by-one in the submit_count initialisation that
wastes one FIFO slot.

Tested on an MPC885 SoC (SEC1 Lite), and on an MPC8321EMP SoC (SEC2)
with CRYPTO_SELFTESTS_FULL=y.
For the SEC1 Lite, some tests are failing due to a timeout waiting for
request completion. These failed tests existed prior to this series.
On SEC2, there is no failed tests.

Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
Changes in v2:
- Split the first patch into smaller, logically separated patches for
  easier review.
- Added more context on testing on the cover letter.
- Introduce a fix to correctly read hardware descriptor header. This fix
  was motivated by a remark of Sashiko on the v1:
  https://sashiko.dev/#/patchset/20260504-bootlin_test-7-1-rc1_sec_bugfix-v1-0-c97c641976f5%40bootlin.com
- Separate SEC2 64k-1 ahash limitation fix into its own patch.
- Link to v1: https://patch.msgid.link/20260504-bootlin_test-7-1-rc1_sec_bugfix-v1-0-c97c641976f5@bootlin.com

---
Paul Louvel (12):
      crypto: talitos - use dma_sync_single_for_cpu() before reading descriptor header
      crypto: talitos - add chaining of arbitrary number of descriptor for the SEC1
      crypto: talitos - move dma unmapping code in flush_channel() into a standalone dma_unmap_request() function
      crypto: talitos - move dma mapping code in talitos_submit() into a standalone dma_map_request() function
      crypto: talitos - move code in current_desc_hdr() into a standalone function
      crypto: talitos/hash - prepare SEC1 descriptor chaining, remove additional descriptor
      crypto: talitos/hash - use descriptor chaining for SEC1 instead of workqueue
      crypto: talitos/hash - drop workqueue mechanism for SEC1
      crypto: talitos/hash - rename first_desc/last_desc to first_request/last_request
      crypto: talitos/hash - remove useless wrapper
      crypto: talitos/hash - fix SEC2 64k - 1 ahash request limitation
      crypto: talitos - fix invalid submit_count initial value

 drivers/crypto/talitos.c | 578 ++++++++++++++++++++++++-----------------------
 drivers/crypto/talitos.h |  14 ++
 2 files changed, 315 insertions(+), 277 deletions(-)
---
base-commit: db8b9f227833e729faf44a512aa1e88a625b5ad8
change-id: 20260504-bootlin_test-7-1-rc1_sec_bugfix-13169ed07ddc

Best regards,
--  
Paul Louvel <paul.louvel@bootlin.com>
Re: [PATCH v2 00/12] crypto: talitos - fix several issues in the Freescale talitos crypto driver
Posted by Paul Louvel 1 month, 1 week ago
Again, some issues breaking existing crypto implementation in the driver have 
been found upon Sashiko's review.
Please discard this v2.

Many thanks,

On 5/5/26 7:53 PM, Paul Louvel wrote:
> This series fixes several issues in the Freescale talitos crypto driver.
>
> Patch 1 fixes a missing dma_sync_single_for_cpu() before reading a
> descriptor header.
>
> Patches 2-5 add support for chaining an arbitrary number of descriptors
> in the driver for the SEC1 hardware.
>
> Patches 6-9 rework the SEC1 hash implementation to build descriptor
> chains instead of submitting one descriptor at a time via a workqueue.
>
> Patch 10 fixes the same ahash request size limitation on SEC2 (64k - 1
> bytes), by splitting ahash_done() into SEC1 and SEC2 paths so that SEC2
> iterates through descriptors sequentially.
>
> Patch 11 fixes an off-by-one in the submit_count initialisation that
> wastes one FIFO slot.
>
> Tested on an MPC885 SoC (SEC1 Lite), and on an MPC8321EMP SoC (SEC2)
> with CRYPTO_SELFTESTS_FULL=y.
> For the SEC1 Lite, some tests are failing due to a timeout waiting for
> request completion. These failed tests existed prior to this series.
> On SEC2, there is no failed tests.
>
> Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
> ---
> Changes in v2:
> - Split the first patch into smaller, logically separated patches for
>    easier review.
> - Added more context on testing on the cover letter.
> - Introduce a fix to correctly read hardware descriptor header. This fix
>    was motivated by a remark of Sashiko on the v1:
>    https://sashiko.dev/#/patchset/20260504-bootlin_test-7-1-rc1_sec_bugfix-v1-0-c97c641976f5%40bootlin.com
> - Separate SEC2 64k-1 ahash limitation fix into its own patch.
> - Link to v1: https://patch.msgid.link/20260504-bootlin_test-7-1-rc1_sec_bugfix-v1-0-c97c641976f5@bootlin.com
>
> ---
> Paul Louvel (12):
>        crypto: talitos - use dma_sync_single_for_cpu() before reading descriptor header
>        crypto: talitos - add chaining of arbitrary number of descriptor for the SEC1
>        crypto: talitos - move dma unmapping code in flush_channel() into a standalone dma_unmap_request() function
>        crypto: talitos - move dma mapping code in talitos_submit() into a standalone dma_map_request() function
>        crypto: talitos - move code in current_desc_hdr() into a standalone function
>        crypto: talitos/hash - prepare SEC1 descriptor chaining, remove additional descriptor
>        crypto: talitos/hash - use descriptor chaining for SEC1 instead of workqueue
>        crypto: talitos/hash - drop workqueue mechanism for SEC1
>        crypto: talitos/hash - rename first_desc/last_desc to first_request/last_request
>        crypto: talitos/hash - remove useless wrapper
>        crypto: talitos/hash - fix SEC2 64k - 1 ahash request limitation
>        crypto: talitos - fix invalid submit_count initial value
>
>   drivers/crypto/talitos.c | 578 ++++++++++++++++++++++++-----------------------
>   drivers/crypto/talitos.h |  14 ++
>   2 files changed, 315 insertions(+), 277 deletions(-)
> ---
> base-commit: db8b9f227833e729faf44a512aa1e88a625b5ad8
> change-id: 20260504-bootlin_test-7-1-rc1_sec_bugfix-13169ed07ddc
>
> Best regards,
> --
> Paul Louvel <paul.louvel@bootlin.com>
>
-- 
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com