crypto: atmel-tdes - zero-initialize device state
Subsystems (2)
PATCH 1/1 crypto: atmel-tdes - zero-initialize device state
Commit c659d07f11a3 ("crypto: atmel-tdes - Switch to managed version of kzalloc") accidentally replaced kzalloc() with devm_kmalloc(), so the device state is no longer zeroed.
atmel_tdes_hw_init() tests dd->flags during probe: a stale TDES_FLAGS_INIT skips the hardware reset, and a stale TDES_FLAGS_BUSY makes atmel_tdes_handle_queue() treat the engine as permanently busy, leaving every request queued and never dispatched.
Seen on a SAM9X75 Curiosity: the first TDES request after boot never completes and the TDES interrupt count stays at zero, while the AES and SHA engines on the same SoC work normally.
Switch to devm_kzalloc(), matching the Atmel AES and SHA drivers.
--- drivers/crypto/atmel-tdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/atmel-tdes.c +1 -1
@@ -933,7 +933,7 @@ static int atmel_tdes_probe(struct platform_device *pdev)struct resource *tdes_res;int err; - tdes_dd =devm_kmalloc (&pdev->dev,sizeof (*tdes_dd),GFP_KERNEL ); + tdes_dd =devm_kzalloc (&pdev->dev,sizeof (*tdes_dd),GFP_KERNEL );if (!tdes_dd)return -ENOMEM ;
Signature · 1 line
2.39.5 (Apple Git-154)
Quoted 15 lines · Karl Mehltretter
Commit
c659d07f11a3("crypto: atmel-tdes - Switch to managed version of kzalloc") accidentally replacedkzalloc()withdevm_kmalloc(), so the device state is no longer zeroed.
atmel_tdes_hw_init()testsdd->flagsduring probe: a staleTDES_FLAGS_INITskips the hardware reset, and a staleTDES_FLAGS_BUSYmakesatmel_tdes_handle_queue()treat the engine as permanently busy, leaving every request queued and never dispatched.Seen on a SAM9X75 Curiosity: the first TDES request after boot never completes and the TDES interrupt count stays at zero, while the AES and SHA engines on the same SoC work normally.
Switch to
devm_kzalloc(), matching the Atmel AES and SHA drivers.
Quoted 7 lines
Fixes c659d07f11a3 ("crypto: atmel-tdes - Switch to managed version of kzalloc")Assisted-by LLMSigned-off-by Karl Mehltretter <[email protected]>--- drivers/crypto/atmel-tdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
LGTM, thanks.
Herbert Xu
maintainerQuoted 15 lines · Karl Mehltretter
Commit
c659d07f11a3("crypto: atmel-tdes - Switch to managed version of kzalloc") accidentally replacedkzalloc()withdevm_kmalloc(), so the device state is no longer zeroed.
atmel_tdes_hw_init()testsdd->flagsduring probe: a staleTDES_FLAGS_INITskips the hardware reset, and a staleTDES_FLAGS_BUSYmakesatmel_tdes_handle_queue()treat the engine as permanently busy, leaving every request queued and never dispatched.Seen on a SAM9X75 Curiosity: the first TDES request after boot never completes and the TDES interrupt count stays at zero, while the AES and SHA engines on the same SoC work normally.
Switch to
devm_kzalloc(), matching the Atmel AES and SHA drivers.
Quoted 7 lines
Fixes c659d07f11a3 ("crypto: atmel-tdes - Switch to managed version of kzalloc")Assisted-by LLMSigned-off-by Karl Mehltretter <[email protected]>--- drivers/crypto/atmel-tdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt