From 3bc47bcc7c95fa7d5b32215016ddef6d01f740de Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 12:51:40 +0900 Subject: [PATCH] scsi: ufs: fix ufs power mode and link power state Change-Id: Id9e4677e5e8c71aa060a922b75eba8a84f42d00d Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 71556a9b3481..2b6ac1148e5a 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5352,11 +5352,6 @@ skip_pending_xfer_clear: __func__); hba->ufshcd_state = UFSHCD_STATE_ERROR; } - /* - * Inform scsi mid-layer that we did reset and allow to handle - * Unit Attention properly. - */ - scsi_report_bus_reset(hba->host, 0); hba->saved_err = 0; hba->saved_uic_err = 0; } @@ -7629,9 +7624,17 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) { int ret; enum uic_link_state old_link_state; + enum ufs_pm_level pm_lvl; bool gating_allowed = !ufshcd_can_fake_clkgating(hba); hba->pm_op_in_progress = 1; + if (ufshcd_is_system_pm(pm_op)) + pm_lvl = hba->spm_lvl; + else + pm_lvl = hba->rpm_lvl; + + if (ufs_get_pm_lvl_to_link_pwr_state(pm_lvl) == UIC_LINK_OFF_STATE) + hba->uic_link_state = UIC_LINK_OFF_STATE; old_link_state = hba->uic_link_state; ufshcd_hba_vreg_set_hpm(hba); -- 2.20.1