From abce936f233669cad0a459bbdff10cdaf519183a Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Thu, 2 Sep 2021 11:11:45 +0800 Subject: [PATCH] drivers: rkflash: Add mutex for deinit ops. Change-Id: I477c161cb22f58263963a4d8e0d08eaeda676f69 Signed-off-by: Jon Lin --- drivers/rkflash/rkflash_blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rkflash/rkflash_blk.c b/drivers/rkflash/rkflash_blk.c index cfb3a3ba5f76..3f4d9871c649 100644 --- a/drivers/rkflash/rkflash_blk.c +++ b/drivers/rkflash/rkflash_blk.c @@ -776,6 +776,8 @@ void rkflash_dev_shutdown(void) wake_up(&mytr.thread_wq); wait_for_completion(&mytr.thread_exit); } + mutex_lock(&g_flash_ops_mutex); g_boot_ops->deinit(); + mutex_unlock(&g_flash_ops_mutex); pr_info("rkflash_shutdown:OK\n"); }