Skip to content

Commit ce45488

Browse files
committed
ata: libata-scsi: do not use the deferred QC feature for ATA_DEFER_PORT
The deferred QC feature was meant to handle mixed NCQ and non-NCQ commands, i.e. for return value ATA_DEFER_LINK. ATA_DEFER_PORT is returned by PATA drivers, but also certain SATA drivers like sata_mv and sata_sil24 that uses ap->excl_link to workaround hardware bugs in these HBAs. Regardless of the reason, using the deferred QC feature for ATA_DEFER_PORT is always wrong, and will break the ap->excl_link usage of the SATA drivers that rely on that feature. Modify ata_scsi_qc_issue() to only use the deferred QC feature when mixing NCQ and non-NCQ commands, i.e. ATA_DEFER_LINK. Fixes: 0ea8408 ("ata: libata-scsi: avoid Non-NCQ command starvation") Tested-by: Tommy Kelly <linux@tkel.ly> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
1 parent 360190b commit ce45488

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/ata/libata-scsi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,11 +1789,11 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
17891789
goto defer_qc;
17901790
case ATA_DEFER_PORT:
17911791
ret = SCSI_MLQUEUE_HOST_BUSY;
1792-
goto defer_qc;
1792+
goto free_qc;
17931793
default:
17941794
WARN_ON_ONCE(1);
17951795
ret = SCSI_MLQUEUE_HOST_BUSY;
1796-
goto defer_qc;
1796+
goto free_qc;
17971797
}
17981798

17991799
issue_qc:
@@ -1813,6 +1813,7 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
18131813
return 0;
18141814
}
18151815

1816+
free_qc:
18161817
/* Force a requeue of the command to defer its execution. */
18171818
ata_qc_free(qc);
18181819

0 commit comments

Comments
 (0)