提交 1918651f 编写于 作者: R Randall Huang 提交者: Martin K. Petersen

scsi: ufs: Clear UAC for RPMB after ufshcd resets

If RPMB is not provisioned, we may see RPMB failure after UFS
suspend/resume.  Inject request_sense to clear uac in ufshcd reset flow.

Link: https://lore.kernel.org/r/20201201041402.3860525-1-jaegeuk@kernel.orgReported-by: Nkernel test robot <lkp@intel.com>
Reviewed-by: NStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: NRandall Huang <huangrandall@google.com>
Signed-off-by: NLeo Liou <leoliou@google.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@google.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 1fa05700
...@@ -225,6 +225,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba); ...@@ -225,6 +225,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba);
static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd); static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd);
static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag); static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag);
static void ufshcd_hba_exit(struct ufs_hba *hba); static void ufshcd_hba_exit(struct ufs_hba *hba);
static int ufshcd_clear_ua_wluns(struct ufs_hba *hba);
static int ufshcd_probe_hba(struct ufs_hba *hba, bool async); static int ufshcd_probe_hba(struct ufs_hba *hba, bool async);
static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on); static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on);
static int ufshcd_uic_hibern8_enter(struct ufs_hba *hba); static int ufshcd_uic_hibern8_enter(struct ufs_hba *hba);
...@@ -6895,7 +6896,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba) ...@@ -6895,7 +6896,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
/* Establish the link again and restore the device */ /* Establish the link again and restore the device */
err = ufshcd_probe_hba(hba, false); err = ufshcd_probe_hba(hba, false);
if (!err)
ufshcd_clear_ua_wluns(hba);
out: out:
if (err) if (err)
dev_err(hba->dev, "%s: Host init failed %d\n", __func__, err); dev_err(hba->dev, "%s: Host init failed %d\n", __func__, err);
...@@ -8379,13 +8381,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, ...@@ -8379,13 +8381,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
* handling context. * handling context.
*/ */
hba->host->eh_noresume = 1; hba->host->eh_noresume = 1;
if (hba->wlun_dev_clr_ua) { ufshcd_clear_ua_wluns(hba);
ret = ufshcd_send_request_sense(hba, sdp);
if (ret)
goto out;
/* Unit attention condition is cleared now */
hba->wlun_dev_clr_ua = false;
}
cmd[4] = pwr_mode << 4; cmd[4] = pwr_mode << 4;
...@@ -8406,7 +8402,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, ...@@ -8406,7 +8402,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
if (!ret) if (!ret)
hba->curr_dev_pwr_mode = pwr_mode; hba->curr_dev_pwr_mode = pwr_mode;
out:
scsi_device_put(sdp); scsi_device_put(sdp);
hba->host->eh_noresume = 0; hba->host->eh_noresume = 0;
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册