[PATCH 05/10] crypto: atmel-sha: initialize spinlock in probe

Leilei Zhao leilei.zhao at atmel.com
Tue Apr 7 02:45:06 PDT 2015


Kernel will report "BUG: spinlock lockup suspected on CPU#0"
when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the
spinlock is used at the first time. It's caused by uninitialized
spinlock, so just initialize it in probe.

Signed-off-by: Leilei Zhao <leilei.zhao at atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre at atmel.com>
---
 drivers/crypto/atmel-sha.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 9fb8af1..6430f6a 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1367,6 +1367,7 @@ static int atmel_sha_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, sha_dd);
 
 	INIT_LIST_HEAD(&sha_dd->list);
+	spin_lock_init(&sha_dd->lock);
 
 	tasklet_init(&sha_dd->done_task, atmel_sha_done_task,
 					(unsigned long)sha_dd);
-- 
1.7.9.5




More information about the linux-arm-kernel mailing list