#
e02ea6f9 |
| 30-Apr-2024 |
Wolfram Sang <wsa+renesas@sang-engineering.com> |
crypto: sahara - use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_t
crypto: sahara - use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like:
timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT;
with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
44ff4ea1 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - add support for crypto_engine
Convert sahara driver to use crypto_engine, rather than doing manual queue management.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Sign
crypto: sahara - add support for crypto_engine
Convert sahara driver to use crypto_engine, rather than doing manual queue management.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
a7dc2d5c |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - remove error message for bad aes request size
Do not spam the kernel log with unnecessary error messages when processing requests that aren't a multiple of AES block size.
Signed-o
crypto: sahara - remove error message for bad aes request size
Do not spam the kernel log with unnecessary error messages when processing requests that aren't a multiple of AES block size.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
ebbcdd63 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - remove unnecessary NULL assignments
Remove unnecessary 'dev_ptr' NULL assignments in sahara_remove() and sahara_probe().
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
crypto: sahara - remove unnecessary NULL assignments
Remove unnecessary 'dev_ptr' NULL assignments in sahara_remove() and sahara_probe().
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
1eece9c6 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - remove 'active' flag from sahara_aes_reqctx struct
The 'active' flag is only used to indirectly set the 'first' flag. Drop the 'active' flag and set 'first' directly in sahara_sha_i
crypto: sahara - remove 'active' flag from sahara_aes_reqctx struct
The 'active' flag is only used to indirectly set the 'first' flag. Drop the 'active' flag and set 'first' directly in sahara_sha_init().
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
2548c7a9 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - use dev_err_probe()
Switch to use dev_err_probe() to simplify the error paths and unify message template. While at it, also remove explicit error messages from every potential -ENOM
crypto: sahara - use dev_err_probe()
Switch to use dev_err_probe() to simplify the error paths and unify message template. While at it, also remove explicit error messages from every potential -ENOMEM.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
2f8547af |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - use devm_clk_get_enabled()
Use devm_clk_get_enabled() helper to simplify probe/remove code. Also, use dev_err_probe() for error reporting.
Signed-off-by: Ovidiu Panait <ovidiu.pana
crypto: sahara - use devm_clk_get_enabled()
Use devm_clk_get_enabled() helper to simplify probe/remove code. Also, use dev_err_probe() for error reporting.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
efadd1a9 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - use BIT() macro
Where applicable, use BIT() macro instead of shift operation to improve readability. No functional change.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com
crypto: sahara - use BIT() macro
Where applicable, use BIT() macro instead of shift operation to improve readability. No functional change.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
8a8f5d33 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - clean up macro indentation
Use the same indentation style for all macros.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana
crypto: sahara - clean up macro indentation
Use the same indentation style for all macros.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
a3c6f4f4 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - do not resize req->src when doing hash operations
When testing sahara sha256 speed performance with tcrypt (mode=404) on imx53-qsrb board, multiple "Invalid numbers of src SG." erro
crypto: sahara - do not resize req->src when doing hash operations
When testing sahara sha256 speed performance with tcrypt (mode=404) on imx53-qsrb board, multiple "Invalid numbers of src SG." errors are reported. This was traced to sahara_walk_and_recalc() resizing req->src and causing the subsequent dma_map_sg() call to fail.
Now that the previous commit fixed sahara_sha_hw_links_create() to take into account the actual request size, rather than relying on sg->length values, the resize operation is no longer necessary.
Therefore, remove sahara_walk_and_recalc() and simplify associated logic.
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
7bafa74d |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - fix processing hash requests with req->nbytes < sg->length
It's not always the case that the entire sg entry needs to be processed. Currently, when nbytes is less than sg->length, "
crypto: sahara - fix processing hash requests with req->nbytes < sg->length
It's not always the case that the entire sg entry needs to be processed. Currently, when nbytes is less than sg->length, "Descriptor length" errors are encountered.
To fix this, take the actual request size into account when populating the hw links.
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
5deff027 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - improve error handling in sahara_sha_process()
sahara_sha_hw_data_descriptor_create() returns negative error codes on failure, so make sure the errors are correctly handled / propag
crypto: sahara - improve error handling in sahara_sha_process()
sahara_sha_hw_data_descriptor_create() returns negative error codes on failure, so make sure the errors are correctly handled / propagated.
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
2dba8e1d |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - fix wait_for_completion_timeout() error handling
The sg lists are not unmapped in case of timeout errors. Fix this.
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256"
crypto: sahara - fix wait_for_completion_timeout() error handling
The sg lists are not unmapped in case of timeout errors. Fix this.
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256") Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
efcb50f4 |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - fix ahash reqsize
Set the reqsize for sha algorithms to sizeof(struct sahara_sha_reqctx), the extra space is not needed.
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1
crypto: sahara - fix ahash reqsize
Set the reqsize for sha algorithms to sizeof(struct sahara_sha_reqctx), the extra space is not needed.
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
d1d6351e |
| 24-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - handle zero-length aes requests
In case of a zero-length input, exit gracefully from sahara_aes_crypt().
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator."
crypto: sahara - handle zero-length aes requests
In case of a zero-length input, exit gracefully from sahara_aes_crypt().
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
01d70a4b |
| 01-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - avoid skcipher fallback code duplication
Factor out duplicated skcipher fallback handling code to a helper function sahara_aes_fallback(). Also, keep a single check if fallback is r
crypto: sahara - avoid skcipher fallback code duplication
Factor out duplicated skcipher fallback handling code to a helper function sahara_aes_fallback(). Also, keep a single check if fallback is required in sahara_aes_crypt().
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
3d5a31df |
| 01-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - remove unused error field in sahara_dev
The "error" field in sahara_dev struct hasn't been needed/used since commit c0c3c89ae347 ("crypto: sahara - replace tasklets with kthread"),
crypto: sahara - remove unused error field in sahara_dev
The "error" field in sahara_dev struct hasn't been needed/used since commit c0c3c89ae347 ("crypto: sahara - replace tasklets with kthread"), so remove the remaining references.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
ee6e6f0a |
| 01-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - fix error handling in sahara_hw_descriptor_create()
Do not call dma_unmap_sg() for scatterlists that were not mapped successfully.
Fixes: 5de8875281e1 ("crypto: sahara - Add driver
crypto: sahara - fix error handling in sahara_hw_descriptor_create()
Do not call dma_unmap_sg() for scatterlists that were not mapped successfully.
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
5b8668ce |
| 01-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - fix processing requests with cryptlen < sg->length
It's not always the case that the entire sg entry needs to be processed. Currently, when cryptlen is less than sg->legth, "Descrip
crypto: sahara - fix processing requests with cryptlen < sg->length
It's not always the case that the entire sg entry needs to be processed. Currently, when cryptlen is less than sg->legth, "Descriptor length" errors are encountered.
The error was noticed when testing xts(sahara-ecb-aes) with arbitrary sized input data. To fix this, take the actual request size into account when populating the hw links.
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
afffcf3d |
| 01-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - fix ahash selftest failure
update() calls should not modify the result buffer, so add an additional check for "rctx->last" to make sure that only the final hash value is copied into
crypto: sahara - fix ahash selftest failure
update() calls should not modify the result buffer, so add an additional check for "rctx->last" to make sure that only the final hash value is copied into the buffer.
Fixes the following selftest failure: alg: ahash: sahara-sha256 update() used result buffer on test vector 3, cfg="init+update+final aligned buffer"
Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
9f10bc28 |
| 01-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - fix cbc selftest failure
The kernel crypto API requires that all CBC implementations update the IV buffer to contain the last ciphertext block.
This fixes the following cbc selftes
crypto: sahara - fix cbc selftest failure
The kernel crypto API requires that all CBC implementations update the IV buffer to contain the last ciphertext block.
This fixes the following cbc selftest error: alg: skcipher: sahara-cbc-aes encryption test failed (wrong output IV) on test vector 0, cfg="in-place (one sglist)"
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
8fd18343 |
| 01-Dec-2023 |
Ovidiu Panait <ovidiu.panait@windriver.com> |
crypto: sahara - remove FLAGS_NEW_KEY logic
Remove the FLAGS_NEW_KEY logic as it has the following issues: - the wrong key may end up being used when there are multiple data streams: t1
crypto: sahara - remove FLAGS_NEW_KEY logic
Remove the FLAGS_NEW_KEY logic as it has the following issues: - the wrong key may end up being used when there are multiple data streams: t1 t2 setkey() encrypt() setkey() encrypt()
encrypt() <--- key from t2 is used - switching between encryption and decryption with the same key is not possible, as the hdr flags are only updated when a new setkey() is performed
With this change, the key is always sent along with the cryptdata when performing encryption/decryption operations.
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
a48c68aa |
| 20-Oct-2023 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
crypto: sahara - Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do err
crypto: sahara - Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
b0cc7491 |
| 14-Jul-2023 |
Rob Herring <robh@kernel.org> |
crypto: drivers - Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As par
crypto: drivers - Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes.
Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
aedf818b |
| 17-Mar-2023 |
Yu Zhe <yuzhe@nfschina.com> |
crypto: drivers - remove unnecessary (void*) conversions
Pointer variables of void * type do not require type cast.
Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Signed-off-by: Herbert Xu <herbert@gon
crypto: drivers - remove unnecessary (void*) conversions
Pointer variables of void * type do not require type cast.
Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|