scsi: ufs: Revert "Retry aborted SCSI commands instead of completing these successfully"
Commit73dc3c4ac7
("scsi: ufs: Retry aborted SCSI commands instead of completing these successfully") is not necessary. If a SCSI command is aborted successfully the UFS controller has not modified the command status and the command status still has the value assigned by ufshcd_prepare_req_desc_hdr(), namely OCS_INVALID_COMMAND_STATUS. The function ufshcd_transfer_rsp_status() requeues commands that have an invalid command status. Hence revert commit73dc3c4ac7
. Link: https://lore.kernel.org/r/20211020214024.2007615-2-bvanassche@acm.org Acked-by: Avri Altman <Avri.Altman@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
12b6fcd0ea
commit
1168252357
@ -5248,11 +5248,9 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
|
|||||||
* __ufshcd_transfer_req_compl - handle SCSI and query command completion
|
* __ufshcd_transfer_req_compl - handle SCSI and query command completion
|
||||||
* @hba: per adapter instance
|
* @hba: per adapter instance
|
||||||
* @completed_reqs: bitmask that indicates which requests to complete
|
* @completed_reqs: bitmask that indicates which requests to complete
|
||||||
* @retry_requests: whether to ask the SCSI core to retry completed requests
|
|
||||||
*/
|
*/
|
||||||
static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
|
static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
|
||||||
unsigned long completed_reqs,
|
unsigned long completed_reqs)
|
||||||
bool retry_requests)
|
|
||||||
{
|
{
|
||||||
struct ufshcd_lrb *lrbp;
|
struct ufshcd_lrb *lrbp;
|
||||||
struct scsi_cmnd *cmd;
|
struct scsi_cmnd *cmd;
|
||||||
@ -5268,8 +5266,7 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
|
|||||||
if (unlikely(ufshcd_should_inform_monitor(hba, lrbp)))
|
if (unlikely(ufshcd_should_inform_monitor(hba, lrbp)))
|
||||||
ufshcd_update_monitor(hba, lrbp);
|
ufshcd_update_monitor(hba, lrbp);
|
||||||
ufshcd_add_command_trace(hba, index, UFS_CMD_COMP);
|
ufshcd_add_command_trace(hba, index, UFS_CMD_COMP);
|
||||||
result = retry_requests ? DID_BUS_BUSY << 16 :
|
result = ufshcd_transfer_rsp_status(hba, lrbp);
|
||||||
ufshcd_transfer_rsp_status(hba, lrbp);
|
|
||||||
scsi_dma_unmap(cmd);
|
scsi_dma_unmap(cmd);
|
||||||
cmd->result = result;
|
cmd->result = result;
|
||||||
/* Mark completed command as NULL in LRB */
|
/* Mark completed command as NULL in LRB */
|
||||||
@ -5295,14 +5292,12 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
|
|||||||
/**
|
/**
|
||||||
* ufshcd_transfer_req_compl - handle SCSI and query command completion
|
* ufshcd_transfer_req_compl - handle SCSI and query command completion
|
||||||
* @hba: per adapter instance
|
* @hba: per adapter instance
|
||||||
* @retry_requests: whether or not to ask to retry requests
|
|
||||||
*
|
*
|
||||||
* Returns
|
* Returns
|
||||||
* IRQ_HANDLED - If interrupt is valid
|
* IRQ_HANDLED - If interrupt is valid
|
||||||
* IRQ_NONE - If invalid interrupt
|
* IRQ_NONE - If invalid interrupt
|
||||||
*/
|
*/
|
||||||
static irqreturn_t ufshcd_transfer_req_compl(struct ufs_hba *hba,
|
static irqreturn_t ufshcd_transfer_req_compl(struct ufs_hba *hba)
|
||||||
bool retry_requests)
|
|
||||||
{
|
{
|
||||||
unsigned long completed_reqs, flags;
|
unsigned long completed_reqs, flags;
|
||||||
u32 tr_doorbell;
|
u32 tr_doorbell;
|
||||||
@ -5331,8 +5326,7 @@ static irqreturn_t ufshcd_transfer_req_compl(struct ufs_hba *hba,
|
|||||||
spin_unlock_irqrestore(&hba->outstanding_lock, flags);
|
spin_unlock_irqrestore(&hba->outstanding_lock, flags);
|
||||||
|
|
||||||
if (completed_reqs) {
|
if (completed_reqs) {
|
||||||
__ufshcd_transfer_req_compl(hba, completed_reqs,
|
__ufshcd_transfer_req_compl(hba, completed_reqs);
|
||||||
retry_requests);
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
} else {
|
} else {
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
@ -5831,13 +5825,7 @@ out:
|
|||||||
/* Complete requests that have door-bell cleared */
|
/* Complete requests that have door-bell cleared */
|
||||||
static void ufshcd_complete_requests(struct ufs_hba *hba)
|
static void ufshcd_complete_requests(struct ufs_hba *hba)
|
||||||
{
|
{
|
||||||
ufshcd_transfer_req_compl(hba, /*retry_requests=*/false);
|
ufshcd_transfer_req_compl(hba);
|
||||||
ufshcd_tmc_handler(hba);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ufshcd_retry_aborted_requests(struct ufs_hba *hba)
|
|
||||||
{
|
|
||||||
ufshcd_transfer_req_compl(hba, /*retry_requests=*/true);
|
|
||||||
ufshcd_tmc_handler(hba);
|
ufshcd_tmc_handler(hba);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6186,7 +6174,8 @@ again:
|
|||||||
}
|
}
|
||||||
|
|
||||||
lock_skip_pending_xfer_clear:
|
lock_skip_pending_xfer_clear:
|
||||||
ufshcd_retry_aborted_requests(hba);
|
/* Complete the requests that are cleared by s/w */
|
||||||
|
ufshcd_complete_requests(hba);
|
||||||
|
|
||||||
spin_lock_irqsave(hba->host->host_lock, flags);
|
spin_lock_irqsave(hba->host->host_lock, flags);
|
||||||
hba->silence_err_logs = false;
|
hba->silence_err_logs = false;
|
||||||
@ -6478,7 +6467,7 @@ static irqreturn_t ufshcd_sl_intr(struct ufs_hba *hba, u32 intr_status)
|
|||||||
retval |= ufshcd_tmc_handler(hba);
|
retval |= ufshcd_tmc_handler(hba);
|
||||||
|
|
||||||
if (intr_status & UTP_TRANSFER_REQ_COMPL)
|
if (intr_status & UTP_TRANSFER_REQ_COMPL)
|
||||||
retval |= ufshcd_transfer_req_compl(hba, /*retry_requests=*/false);
|
retval |= ufshcd_transfer_req_compl(hba);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -6898,7 +6887,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
|
|||||||
err = ufshcd_clear_cmd(hba, pos);
|
err = ufshcd_clear_cmd(hba, pos);
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
__ufshcd_transfer_req_compl(hba, 1U << pos, false);
|
__ufshcd_transfer_req_compl(hba, 1U << pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7060,7 +7049,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
|
|||||||
dev_err(hba->dev,
|
dev_err(hba->dev,
|
||||||
"%s: cmd was completed, but without a notifying intr, tag = %d",
|
"%s: cmd was completed, but without a notifying intr, tag = %d",
|
||||||
__func__, tag);
|
__func__, tag);
|
||||||
__ufshcd_transfer_req_compl(hba, 1UL << tag, /*retry_requests=*/false);
|
__ufshcd_transfer_req_compl(hba, 1UL << tag);
|
||||||
goto release;
|
goto release;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7126,7 +7115,7 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
|
|||||||
ufshpb_reset_host(hba);
|
ufshpb_reset_host(hba);
|
||||||
ufshcd_hba_stop(hba);
|
ufshcd_hba_stop(hba);
|
||||||
hba->silence_err_logs = true;
|
hba->silence_err_logs = true;
|
||||||
ufshcd_retry_aborted_requests(hba);
|
ufshcd_complete_requests(hba);
|
||||||
hba->silence_err_logs = false;
|
hba->silence_err_logs = false;
|
||||||
|
|
||||||
/* scale up clocks to max frequency before full reinitialization */
|
/* scale up clocks to max frequency before full reinitialization */
|
||||||
|
Loading…
Reference in New Issue
Block a user