From c7cf4cc2cb42cf68b9bbfef3f51318706436b9a8 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 12:58:56 +0900 Subject: [PATCH] scsi: ufs: guarantee link's active state for device management Change-Id: I5655825ab08281495abd0051a4c73799a32cee3d Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2b6ac1148e5a..5122b6bd95ff 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2623,7 +2623,8 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, unsigned long flags; if (!ufshcd_is_link_active(hba)) { - + flush_work(&hba->clk_gating.ungate_work); + if (!ufshcd_is_link_active(hba)) return -EPERM; } down_read(&hba->clk_scaling_lock); -- 2.20.1