[PATCH 3/3] scsi: ufs: reset the ufs device before link startup retry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the link startup command fails, trigger hardware reset to reset
the UFS device before link startup retry.

Signed-off-by: DooHyun Hwang <dh0421.hwang@xxxxxxxxxxx>
---
 drivers/scsi/ufs/ufshcd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 32cb3b0dcbcf..a87e98631a72 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4644,7 +4644,15 @@ static int ufshcd_link_startup(struct ufs_hba *hba)
 				       (u32)ret);
 
 		if (link_startup_again) {
+			int err = 0;
+
 			link_startup_again = false;
+
+			/* Reset the attached device before retrying */
+			err = ufshcd_vops_device_reset(hba);
+			if (err && (err != -EOPNOTSUPP))
+				ufshcd_update_evt_hist(hba, UFS_EVT_DEV_RESET, err);
+
 			retries = DME_LINKSTARTUP_RETRIES;
 			goto link_startup;
 		}
-- 
2.29.0




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux