mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
FROMLIST: 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/linux-scsi/20201201041402.3860525-1-jaegeuk@kernel.org/ Signed-off-by: Randall Huang <huangrandall@google.com> Signed-off-by: Leo Liou <leoliou@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@google.com> Change-Id: Icf52bab05474f5180d79aa5419f2fc174b521e22
This commit is contained in:
committed by
Jaegeuk Kim
parent
ea89512d45
commit
f2da571038
@@ -220,6 +220,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_clear_tm_cmd(struct ufs_hba *hba, int tag);
|
||||
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_setup_clocks(struct ufs_hba *hba, bool on,
|
||||
bool skip_ref_clk);
|
||||
@@ -6872,7 +6873,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
|
||||
|
||||
/* Establish the link again and restore the device */
|
||||
err = ufshcd_probe_hba(hba, false);
|
||||
|
||||
if (!err)
|
||||
ufshcd_clear_ua_wluns(hba);
|
||||
out:
|
||||
if (err)
|
||||
dev_err(hba->dev, "%s: Host init failed %d\n", __func__, err);
|
||||
@@ -8363,13 +8365,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
|
||||
* handling context.
|
||||
*/
|
||||
hba->host->eh_noresume = 1;
|
||||
if (hba->wlun_dev_clr_ua) {
|
||||
ret = ufshcd_send_request_sense(hba, sdp);
|
||||
if (ret)
|
||||
goto out;
|
||||
/* Unit attention condition is cleared now */
|
||||
hba->wlun_dev_clr_ua = false;
|
||||
}
|
||||
ufshcd_clear_ua_wluns(hba);
|
||||
|
||||
cmd[4] = pwr_mode << 4;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user