From abebc6eb17db8285b38a91e33b04ffc0ef3e7797 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 11:00:55 +0900 Subject: [PATCH] scsi: ufs: don't do anything during error recovery during error Change-Id: Ie43735be58a7afd20a32e88e73b7a11a29db28a3 Signed-off-by: hgchu --- drivers/scsi/ufs/ufs_quirks.h | 1 + drivers/scsi/ufs/ufshcd.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufs_quirks.h b/drivers/scsi/ufs/ufs_quirks.h index 71f73d1d1ad1..88bd4275149e 100644 --- a/drivers/scsi/ufs/ufs_quirks.h +++ b/drivers/scsi/ufs/ufs_quirks.h @@ -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 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 53c69646937e..5d0b203856ec 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -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: -- 2.20.1