Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c55794c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: fix multiple ufs spec violation"

parents ac3e1912 5dfd6e2c
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ ufs_get_pm_lvl_to_link_pwr_state(enum ufs_pm_level lvl)
static void ufshcd_tmc_handler(struct ufs_hba *hba);
static void ufshcd_async_scan(void *data, async_cookie_t cookie);
static int ufshcd_reset_and_restore(struct ufs_hba *hba);
static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd);
static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag);
static void ufshcd_hba_exit(struct ufs_hba *hba);
static int ufshcd_probe_hba(struct ufs_hba *hba);
@@ -4069,6 +4070,17 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
	host = cmd->device->host;
	hba = shost_priv(host);
	tag = cmd->request->tag;
	lrbp = &hba->lrb[tag];

	/*
	 * Task abort to the device W-LUN is illegal. When this command
	 * will fail, due to spec violation, scsi err handling next step
	 * will be to send LU reset which, again, is a spec violation.
	 * To avoid these unnecessary/illegal step we skip to the last error
	 * handling stage: reset and restore.
	 */
	if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN)
		return ufshcd_eh_host_reset_handler(cmd);

	ufshcd_hold(hba, false);
	/* If command is already aborted/completed, return SUCCESS */
@@ -4089,7 +4101,6 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
	ufshcd_print_pwr_info(hba);
	ufshcd_print_trs(hba, 1 << tag, true);

	lrbp = &hba->lrb[tag];
	for (poll_cnt = 100; poll_cnt; poll_cnt--) {
		err = ufshcd_issue_tm_cmd(hba, lrbp->lun, lrbp->task_tag,
				UFS_QUERY_TASK, &resp);