scsi: ufs: Add device reset in link recovery path
authorCan Guo <cang@codeaurora.org>
Fri, 15 Nov 2019 06:09:24 +0000 (22:09 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 19 Nov 2019 04:15:50 +0000 (23:15 -0500)
In order to recover from hibern8 exit failure, perform a reset in link
recovery path before issuing link start-up.

Link: https://lore.kernel.org/r/1573798172-20534-2-git-send-email-cang@codeaurora.org
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index 977d0c6fef9573b1bdff74f74a8eb32a18267808..e644e1e29c9144b06d35b9a8b3dd74e49820d778 100644 (file)
@@ -3859,6 +3859,9 @@ static int ufshcd_link_recovery(struct ufs_hba *hba)
        ufshcd_set_eh_in_progress(hba);
        spin_unlock_irqrestore(hba->host->host_lock, flags);
 
+       /* Reset the attached device */
+       ufshcd_vops_device_reset(hba);
+
        ret = ufshcd_host_reset_and_restore(hba);
 
        spin_lock_irqsave(hba->host->host_lock, flags);