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

Commit 35e86b53 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

[PATCH] libata: dec scmd->retries for qcs with zero err_mask



qcs might get retried because of unrelated failure.  e.g. NCQ command
failure causes the whole command set to be aborted.  Decrement
scmd->retries for such retrials to avoid unnecessarily failing
commands.  Note that scmd->retries will be incremented the first time.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d69cf37d
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -831,11 +831,14 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc)
 *	should be retried.  To be used from EH.
 *	should be retried.  To be used from EH.
 *
 *
 *	SCSI midlayer limits the number of retries to scmd->allowed.
 *	SCSI midlayer limits the number of retries to scmd->allowed.
 *	This function might need to adjust scmd->retries for commands
 *	scmd->retries is decremented for commands which get retried
 *	which get retried due to unrelated NCQ failures.
 *	due to unrelated failures (qc->err_mask is zero).
 */
 */
void ata_eh_qc_retry(struct ata_queued_cmd *qc)
void ata_eh_qc_retry(struct ata_queued_cmd *qc)
{
{
	struct scsi_cmnd *scmd = qc->scsicmd;
	if (!qc->err_mask && scmd->retries)
		scmd->retries--;
	__ata_eh_qc_complete(qc);
	__ata_eh_qc_complete(qc);
}
}