scsi: ufs: don't do anything during error recovery during error
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 02:00:55 +0000 (11:00 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:16 +0000 (17:20 +0900)
Change-Id: Ie43735be58a7afd20a32e88e73b7a11a29db28a3
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufs_quirks.h
drivers/scsi/ufs/ufshcd.c

index 71f73d1d1ad1fb9b7c357c65baf0f49ec9dfa780..88bd4275149e6616cbcfb280db55942fb3e3f6e9 100644 (file)
@@ -52,6 +52,7 @@ struct ufs_dev_fix {
  * TX_LCC_ENABLE attribute of host to 0).
  */
 #define UFS_DEVICE_QUIRK_BROKEN_LCC (1 << 0)
+#define UFS_DEVICE_QUIRK_BROKEN_LINEREST       UFS_BIT(1)
 
 /*
  * Some UFS devices don't need VCCQ rail for device operations. Enabling this
index 53c69646937eae66229dd79d394f1339f890ccc3..5d0b203856ec19f9c6229a35c3cf4369864c229c 100644 (file)
@@ -1554,7 +1554,8 @@ static void ufshcd_gate_work(struct work_struct *work)
        if (hba->clk_gating.active_reqs
                || hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL
                || hba->lrb_in_use || hba->outstanding_tasks
-               || hba->active_uic_cmd || hba->uic_async_done)
+               || hba->active_uic_cmd || hba->uic_async_done
+               || scsi_host_in_recovery(hba->host))
                goto rel_lock;
 
        spin_unlock_irqrestore(hba->host->host_lock, flags);
@@ -1609,6 +1610,7 @@ static void __ufshcd_release(struct ufs_hba *hba)
                || hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL
                || hba->lrb_in_use || hba->outstanding_tasks
                || hba->active_uic_cmd || hba->uic_async_done
+               || scsi_host_in_recovery(hba->host)
                || ufshcd_eh_in_progress(hba))
                return;
 
@@ -4675,7 +4677,8 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
                         * UFS device needs urgent BKOPs.
                         */
                        if (!hba->pm_op_in_progress &&
-                           ufshcd_is_exception_event(lrbp->ucd_rsp_ptr))
+                           ufshcd_is_exception_event(lrbp->ucd_rsp_ptr) &&
+                               scsi_host_in_recovery(hba->host)) {
                                schedule_work(&hba->eeh_work);
                        break;
                case UPIU_TRANSACTION_REJECT_UPIU: