forked from Minki/linux
ata: Handle ATA NCQ NO-DATA commands correctly
Add a new taskfile protocol ATA_PROT_NCQ_NODATA to handle ATA NCQ NO-DATA commands correctly. And fixup ata_scsi_zbc_out_xlat() to use it. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
5b51ba6178
commit
5b844b63dd
@ -2611,7 +2611,8 @@ static void ata_eh_link_report(struct ata_link *link)
|
||||
[ATA_PROT_NODATA] = "nodata",
|
||||
[ATA_PROT_PIO] = "pio",
|
||||
[ATA_PROT_DMA] = "dma",
|
||||
[ATA_PROT_NCQ] = "ncq",
|
||||
[ATA_PROT_NCQ] = "ncq dma",
|
||||
[ATA_PROT_NCQ_NODATA] = "ncq nodata",
|
||||
[ATAPI_PROT_NODATA] = "nodata",
|
||||
[ATAPI_PROT_PIO] = "pio",
|
||||
[ATAPI_PROT_DMA] = "dma",
|
||||
|
@ -3082,6 +3082,9 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
|
||||
goto invalid_fld;
|
||||
}
|
||||
|
||||
if (ata_is_ncq(tf->protocol) && (cdb[2] & 0x3) == 0)
|
||||
tf->protocol = ATA_PROT_NCQ_NODATA;
|
||||
|
||||
/* enable LBA */
|
||||
tf->flags |= ATA_TFLAG_LBA;
|
||||
|
||||
@ -3548,7 +3551,7 @@ static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc)
|
||||
|
||||
if (ata_ncq_enabled(qc->dev) &&
|
||||
ata_fpdma_zac_mgmt_out_supported(qc->dev)) {
|
||||
tf->protocol = ATA_PROT_NCQ;
|
||||
tf->protocol = ATA_PROT_NCQ_NODATA;
|
||||
tf->command = ATA_CMD_NCQ_NON_DATA;
|
||||
tf->hob_nsect = ATA_SUBCMD_NCQ_NON_DATA_ZAC_MGMT_OUT;
|
||||
tf->nsect = qc->tag << 3;
|
||||
|
@ -290,6 +290,8 @@ static const char *get_prot_descript(u8 protocol)
|
||||
return "ATA DMA";
|
||||
case ATA_PROT_NCQ:
|
||||
return "ATA NCQ";
|
||||
case ATA_PROT_NCQ_NODATA:
|
||||
return "ATA NCQ no data";
|
||||
case ATAPI_PROT_NODATA:
|
||||
return "ATAPI no data";
|
||||
case ATAPI_PROT_PIO:
|
||||
|
@ -530,6 +530,7 @@ enum ata_tf_protocols {
|
||||
ATA_PROT_PIO, /* PIO data xfer */
|
||||
ATA_PROT_DMA, /* DMA */
|
||||
ATA_PROT_NCQ, /* NCQ */
|
||||
ATA_PROT_NCQ_NODATA, /* NCQ no data */
|
||||
ATAPI_PROT_NODATA, /* packet command, no data */
|
||||
ATAPI_PROT_PIO, /* packet command, PIO data xfer*/
|
||||
ATAPI_PROT_DMA, /* packet command with special DMA sauce */
|
||||
|
@ -1053,6 +1053,8 @@ static inline unsigned int ata_prot_flags(u8 prot)
|
||||
return ATA_PROT_FLAG_DMA;
|
||||
case ATA_PROT_NCQ:
|
||||
return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
|
||||
case ATA_PROT_NCQ_NODATA:
|
||||
return ATA_PROT_FLAG_NCQ;
|
||||
case ATAPI_PROT_NODATA:
|
||||
return ATA_PROT_FLAG_ATAPI;
|
||||
case ATAPI_PROT_PIO:
|
||||
|
@ -126,6 +126,7 @@
|
||||
ata_protocol_name(ATA_PROT_PIO), \
|
||||
ata_protocol_name(ATA_PROT_DMA), \
|
||||
ata_protocol_name(ATA_PROT_NCQ), \
|
||||
ata_protocol_name(ATA_PROT_NCQ_NODATA), \
|
||||
ata_protocol_name(ATAPI_PROT_NODATA), \
|
||||
ata_protocol_name(ATAPI_PROT_PIO), \
|
||||
ata_protocol_name(ATAPI_PROT_DMA))
|
||||
|
Loading…
Reference in New Issue
Block a user