Commit 141f8165 authored by Zang Leigang's avatar Zang Leigang Committed by Martin K. Petersen

scsi: ufs: introduce a new ufshcd_statea UFSHCD_STATE_EH_SCHEDULED

Add a new ufshcd_state, indicats that an err handler may get to run
immediately. Use UFSHCD_STATE_ERROR here looks not literaly correct.
Signed-off-by: default avatarZang Leigang <zangleigang@hisilicon.com>
Reviewed-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6593ccd8
...@@ -125,6 +125,7 @@ enum { ...@@ -125,6 +125,7 @@ enum {
UFSHCD_STATE_RESET, UFSHCD_STATE_RESET,
UFSHCD_STATE_ERROR, UFSHCD_STATE_ERROR,
UFSHCD_STATE_OPERATIONAL, UFSHCD_STATE_OPERATIONAL,
UFSHCD_STATE_EH_SCHEDULED,
}; };
/* UFSHCD error handling flags */ /* UFSHCD error handling flags */
...@@ -1450,6 +1451,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) ...@@ -1450,6 +1451,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
switch (hba->ufshcd_state) { switch (hba->ufshcd_state) {
case UFSHCD_STATE_OPERATIONAL: case UFSHCD_STATE_OPERATIONAL:
break; break;
case UFSHCD_STATE_EH_SCHEDULED:
case UFSHCD_STATE_RESET: case UFSHCD_STATE_RESET:
err = SCSI_MLQUEUE_HOST_BUSY; err = SCSI_MLQUEUE_HOST_BUSY;
goto out_unlock; goto out_unlock;
...@@ -4212,7 +4214,7 @@ static void ufshcd_check_errors(struct ufs_hba *hba) ...@@ -4212,7 +4214,7 @@ static void ufshcd_check_errors(struct ufs_hba *hba)
/* block commands from scsi mid-layer */ /* block commands from scsi mid-layer */
scsi_block_requests(hba->host); scsi_block_requests(hba->host);
hba->ufshcd_state = UFSHCD_STATE_ERROR; hba->ufshcd_state = UFSHCD_STATE_EH_SCHEDULED;
schedule_work(&hba->eh_work); schedule_work(&hba->eh_work);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment