mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
ata: libata-scsi: schedule deferred atapi command
Modify atapi_qc_complete() to call ata_scsi_schedule_deferred_qc() to
ensure that any deferred queued command can execute. This is similar to
ata_scsi_qc_complete() function for regular ATA devices.
Fixes: 0ea84089db ("ata: libata-scsi: avoid Non-NCQ command starvation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
This commit is contained in:
parent
2e1d2e65e7
commit
e7468b3f9b
|
|
@ -2993,6 +2993,7 @@ static void atapi_fixup_inquiry(struct scsi_cmnd *cmd)
|
|||
|
||||
static void atapi_qc_complete(struct ata_queued_cmd *qc)
|
||||
{
|
||||
struct ata_link *link = qc->dev->link;
|
||||
struct scsi_cmnd *cmd = qc->scsicmd;
|
||||
unsigned int err_mask = qc->err_mask;
|
||||
|
||||
|
|
@ -3022,12 +3023,12 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
|
|||
ata_scsi_qc_done(qc, false, 0);
|
||||
else
|
||||
ata_scsi_qc_done(qc, true, SAM_STAT_CHECK_CONDITION);
|
||||
return;
|
||||
goto schedule_deferred;
|
||||
}
|
||||
|
||||
if (cmd->result) {
|
||||
ata_scsi_qc_done(qc, false, 0);
|
||||
return;
|
||||
goto schedule_deferred;
|
||||
}
|
||||
|
||||
/* successful completion path */
|
||||
|
|
@ -3035,6 +3036,9 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
|
|||
atapi_fixup_inquiry(cmd);
|
||||
|
||||
ata_scsi_qc_done(qc, true, SAM_STAT_GOOD);
|
||||
|
||||
schedule_deferred:
|
||||
ata_scsi_schedule_deferred_qc(link);
|
||||
}
|
||||
/**
|
||||
* atapi_xlat - Initialize PACKET taskfile
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user