scsi: ufs: guarantee link's active state for device management
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 03:58:56 +0000 (12:58 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:22 +0000 (17:20 +0900)
Change-Id: I5655825ab08281495abd0051a4c73799a32cee3d
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c

index 2b6ac1148e5a7002718472407a759ae7c84e5854..5122b6bd95ffbc5d8b8785986b99afd018980da6 100644 (file)
@@ -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);