| 27d5a2d1 | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crytpo: sun8i-ce - factor out prepare/unprepare from sun8i_ce_hash_run()
In order to make the ahash code more clear and modular, split the monolithic sun8i_ce_hash_run() callback into two parts, pre
crytpo: sun8i-ce - factor out prepare/unprepare from sun8i_ce_hash_run()
In order to make the ahash code more clear and modular, split the monolithic sun8i_ce_hash_run() callback into two parts, prepare and unprepare (therefore aligning it with the sun8i-ce skcipher code).
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| c3a61eea | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - save hash buffers and dma info to request context
Similar to sun8i-ce skcipher code, move all request-specific data to request context. This simplifies sun8i_ce_hash_run() and it
crypto: sun8i-ce - save hash buffers and dma info to request context
Similar to sun8i-ce skcipher code, move all request-specific data to request context. This simplifies sun8i_ce_hash_run() and it eliminates the remaining kmalloc() calls from the digest path.
Since the 'result' buffer in the request ctx struct is used for from-device DMA, it needs to be properly aligned to CRYPTO_DMA_ALIGN. Therefore: - increase reqsize by CRYPTO_DMA_PADDING - add __aligned(CRYPTO_DMA_ALIGN) attribute for the 'result' buffer - convert all ahash_request_ctx_dma() calls to ahash_request_ctx_dma()
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 49034c03 | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - pass task descriptor to cipher prepare/unprepare
To remove some duplicated code, directly pass 'struct skcipher_request' and 'struct ce_task' pointers to sun8i_ce_cipher_{prepare,
crypto: sun8i-ce - pass task descriptor to cipher prepare/unprepare
To remove some duplicated code, directly pass 'struct skcipher_request' and 'struct ce_task' pointers to sun8i_ce_cipher_{prepare,unprepare}.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 2dc57f02 | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - fold sun8i_ce_cipher_run() into sun8i_ce_cipher_do_one()
Fold sun8i_ce_cipher_run() into it's only caller, sun8i_ce_cipher_do_one(), to eliminate a bit of boilerplate.
Signed-off
crypto: sun8i-ce - fold sun8i_ce_cipher_run() into sun8i_ce_cipher_do_one()
Fold sun8i_ce_cipher_run() into it's only caller, sun8i_ce_cipher_do_one(), to eliminate a bit of boilerplate.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 27eaada0 | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - move bounce_iv and backup_iv to request context
Currently, the iv buffers are allocated per flow during driver probe, which means that the buffers are shared by all requests. This
crypto: sun8i-ce - move bounce_iv and backup_iv to request context
Currently, the iv buffers are allocated per flow during driver probe, which means that the buffers are shared by all requests. This works because the driver is not yet truly asynchronous, since it waits inside do_one_request() for the completion irq.
However, the iv data is request-specific, so it should be part of the request context. Move iv buffers to request context.
The bounce_iv buffer is aligned to sizeof(u32) to match the 'word address' requirement for the task descriptor's iv field.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| cedb1e9e | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - add a new function for dumping task descriptors
In order to remove code duplication, factor out task descriptor dumping to a new function sun8i_ce_dump_task_descriptors().
Signed
crypto: sun8i-ce - add a new function for dumping task descriptors
In order to remove code duplication, factor out task descriptor dumping to a new function sun8i_ce_dump_task_descriptors().
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 6713d984 | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - remove unnecessary __maybe_unused annotations
There are 3 instances of '__maybe_unused' annotations that are not needed, as the variables are always used, so remove them.
Signed-
crypto: sun8i-ce - remove unnecessary __maybe_unused annotations
There are 3 instances of '__maybe_unused' annotations that are not needed, as the variables are always used, so remove them.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 01d7d3c3 | 02-Sep-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - remove boilerplate in sun8i_ce_hash_digest()
Retrieve the dev pointer from tfm context to eliminate some boilerplate code in sun8i_ce_hash_digest().
Signed-off-by: Ovidiu Panait
crypto: sun8i-ce - remove boilerplate in sun8i_ce_hash_digest()
Retrieve the dev pointer from tfm context to eliminate some boilerplate code in sun8i_ce_hash_digest().
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Tested-by: Corentin LABBE <clabbe.montjoie@gmail.com> Reviewed-by: Corentin LABBE <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 003bb374 | 19-May-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - use helpers to get hash block and digest sizes
Use crypto_ahash_blocksize() and crypto_ahash_digestsize() helpers instead of directly accessing 'struct ahash_alg' members.
Signed
crypto: sun8i-ce - use helpers to get hash block and digest sizes
Use crypto_ahash_blocksize() and crypto_ahash_digestsize() helpers instead of directly accessing 'struct ahash_alg' members.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 67a4ad04 | 19-May-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce - remove ivlen field of sun8i_cipher_req_ctx
Remove `ivlen` field of `sun8i_cipher_req_ctx`, as it is not really useful.
The iv length returned by crypto_skcipher_ivsize() is alrea
crypto: sun8i-ce - remove ivlen field of sun8i_cipher_req_ctx
Remove `ivlen` field of `sun8i_cipher_req_ctx`, as it is not really useful.
The iv length returned by crypto_skcipher_ivsize() is already available everywhere and can be used instead.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 7d2461c7 | 01-May-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce-hash - use pm_runtime_resume_and_get()
Replace pm_runtime_get_sync() usage with pm_runtime_resume_and_get() to simplify error handling.
This is recommended in the documentation of
crypto: sun8i-ce-hash - use pm_runtime_resume_and_get()
Replace pm_runtime_get_sync() usage with pm_runtime_resume_and_get() to simplify error handling.
This is recommended in the documentation of pm_runtime_get_sync().
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 2dfc7cd7 | 27-Apr-2025 |
Corentin Labbe <clabbe.montjoie@gmail.com> |
crypto: sun8i-ss - do not use sg_dma_len before calling DMA functions
When testing sun8i-ss with multi_v7_defconfig, all CBC algorithm fail crypto selftests. This is strange since on sunxi_defconfig
crypto: sun8i-ss - do not use sg_dma_len before calling DMA functions
When testing sun8i-ss with multi_v7_defconfig, all CBC algorithm fail crypto selftests. This is strange since on sunxi_defconfig, everything was ok. The problem was in the IV setup loop which never run because sg_dma_len was 0.
Fixes: 359e893e8af4 ("crypto: sun8i-ss - rework handling of IV") Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| b9580cf5 | 25-Apr-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce-cipher - use pm_runtime_resume_and_get()
Replace pm_runtime_get_sync() usage with pm_runtime_resume_and_get() to simplify error handling.
This is recommended in the documentation o
crypto: sun8i-ce-cipher - use pm_runtime_resume_and_get()
Replace pm_runtime_get_sync() usage with pm_runtime_resume_and_get() to simplify error handling.
This is recommended in the documentation of pm_runtime_get_sync(): /** * pm_runtime_get_sync - Bump up usage counter of a device and resume it. ... * Consider using pm_runtime_resume_and_get() instead of it, especially * if its return value is checked by the caller, as this is likely to result * in cleaner code. ... */
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Tested-by: Corentin LABBE <clabbe.montjoie@gmail.com> Acked-by: Corentin LABBE <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 031bc3e8 | 25-Apr-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce-cipher - use IS_ENABLED() checks for debugfs stats
Add IS_ENABLED(CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG) checks before the fallback counter updates to make sure the code is not included
crypto: sun8i-ce-cipher - use IS_ENABLED() checks for debugfs stats
Add IS_ENABLED(CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG) checks before the fallback counter updates to make sure the code is not included when debugfs statistics support is not enabled.
Also, drop the existing ifdef guards, since 'struct sun8i_ce_alg_template' is always defined, even with CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG disabled.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Tested-by: Corentin LABBE <clabbe.montjoie@gmail.com> Acked-by: Corentin LABBE <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 8e379e8f | 25-Apr-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce-cipher - use crypto_skcipher_driver_name()
Use crypto_skcipher_driver_name() helper from <crypto/skcipher.h>, instead of accessing struct crypto_alg directly.
Signed-off-by: Ovidiu
crypto: sun8i-ce-cipher - use crypto_skcipher_driver_name()
Use crypto_skcipher_driver_name() helper from <crypto/skcipher.h>, instead of accessing struct crypto_alg directly.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Acked-by: Corentin LABBE <clabbe.montjoie@gmail.com> Tested-by: Corentin LABBE <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| bfc68ebe | 01-Apr-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce-hash - use API helpers to setup fallback request
Rather than setting up the fallback request by hand, use ahash_request_set_callback() and ahash_request_set_crypt() API helpers to p
crypto: sun8i-ce-hash - use API helpers to setup fallback request
Rather than setting up the fallback request by hand, use ahash_request_set_callback() and ahash_request_set_crypt() API helpers to properly setup the new request.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
| 593c76e1 | 01-Apr-2025 |
Ovidiu Panait <ovidiu.panait.oss@gmail.com> |
crypto: sun8i-ce-hash - add IS_ENABLED() checks to debugfs stats
Add IS_ENABLED(CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG) checks before the fallback counter updates to make sure the code is not included whe
crypto: sun8i-ce-hash - add IS_ENABLED() checks to debugfs stats
Add IS_ENABLED(CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG) checks before the fallback counter updates to make sure the code is not included when debugfs statistics support is not enabled.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|