@@ -7363,9 +7363,27 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd)
int err = SUCCESS;
unsigned long flags;
struct ufs_hba *hba;
+ struct device *dev;
hba = shost_priv(cmd->device->host);
+ /*
+ * If __ufshcd_wl_suspend get fail and runtime_status = RPM_RESUMING,
+ * do link recovery only. Because schedule eh work will get dead lock
+ * in ufshcd_rpm_get_sync to wait wlun resume, but wlun resume get
+ * error and wait eh work finish.
+ */
+ dev = &hba->sdev_ufs_device->sdev_gendev;
+ if (dev->power.runtime_status == RPM_RESUMING) {
+ err = ufshcd_link_recovery(hba);
+ if (err) {
+ dev_err(hba->dev, "WL Device PM: status:%d, err:%d\n",
+ dev->power.runtime_status,
+ dev->power.runtime_error);
+ }
+ return err;
+ }
+
spin_lock_irqsave(hba->host->host_lock, flags);
hba->force_reset = true;
ufshcd_schedule_eh_work(hba);