From: hgchu Date: Fri, 12 Jan 2018 03:58:56 +0000 (+0900) Subject: scsi: ufs: guarantee link's active state for device management X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c7cf4cc2cb42cf68b9bbfef3f51318706436b9a8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git scsi: ufs: guarantee link's active state for device management Change-Id: I5655825ab08281495abd0051a4c73799a32cee3d Signed-off-by: hgchu --- 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);